From nobody Mon Mar 07 16:25:55 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 031DE19FF090; Mon, 7 Mar 2022 16:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KC3jb5LfKz4Zfc; Mon, 7 Mar 2022 16:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646670355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XY2o2sq8F6i+BtBkB+L5m3yPriSQhtsMILw3gL20hZc=; b=TQUmP7J9Uklwt5gHR/f3zVTPOnvtU1rcw+a1+vU8hdJhW3Zj5de3YIB4PxwtMQoW2ThVqA 7wzXqbfXOqCLxTpS4cTcCgYMKk2byDiAMlIVC+Wg5Jje2mzVPx6M5rs1w/kXrTWZqag1Vo jnKy0C59+TrtvH1DbNrhCWIe5X3sSF00q/SIU6deqQVCXpWbkbdTYxRs9LNuj2iZBjFAgg O6U2kfmLjqxm/zME2xX6AxKl3BbJntsyWQDNTBk0G/aEfPbgjyI1ktAH2LMDUEd4m4e5jF 88h/xOxmdTkSLMksOb0cHhfF9klD5dzuKBCUw9Lk2BHfWszydAS/Io8H//ctNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E19336E6; Mon, 7 Mar 2022 16:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 227GPtQ0004052; Mon, 7 Mar 2022 16:25:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 227GPtQU004051; Mon, 7 Mar 2022 16:25:55 GMT (envelope-from git) Date: Mon, 7 Mar 2022 16:25:55 GMT Message-Id: <202203071625.227GPtQU004051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: eb40c0f2f2ce - stable/13 - vt_vga: fix colour in pixel blocks with more than 4 colours List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb40c0f2f2ce5d83707bef2f9c8259312da852d1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646670355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XY2o2sq8F6i+BtBkB+L5m3yPriSQhtsMILw3gL20hZc=; b=KpEusqNCfBGo05ytdfCuX8DUUZ2UlF2/PLcsze/8ubsq366QARTEjRjTAh6pgCCW0vBeu3 0tb3zrmvJLuotvZB8ir9tNv1o5LelDEXiWv7tXefKqestB745kCQ1zeHRPDCUVZMLd9qj/ Kawqnc/kPYGgZqmjkFXPZ4lOyckrpaNOESk/zsITlcGNogQh4a8FnuMy5nGDr1XMJhjxO4 0IRmo9ibjXHJpFR29LcFl3vnMHDCijQQ/9bi30CK/xr8tP9qZKI93+2qOW5+sGjLJ6W13b QYCnwZ8Ma2qvadtHUyNiCUGPJG+kdoa8GujmYiJVg1UUENdEM3tFoC5xy/4VCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646670355; a=rsa-sha256; cv=none; b=UWvKDM9y2G/0WbpFWHg1ozwNPl6gHcGCyAvxJRs5M/m/cWRTmNhQdAQiqYUZ9PdDtuWF4I j3lAePDmYBSLSb8soQJVFsbOUlgEq4Mq6Q3iUz0ezxNLMM97dZTpZvd1ogBu0XXxULm8ec od/KFY+27yMarC+Wq+TZmN26oItoyj610TEdpmXT9Kpekr1YmO1IhtDaAan7Y9sESvrQZ7 SwZOQVVA+Pv638ZAcPYrKfxY52Zg3hmfoIc6r0rJ4+/L4LCl5W8ZlbTA0cCdyEDF6P1hRy UNTp3jqxSOx8hE08sCxW6qxo2CF69uwJUf/Kav54aNUCKkNAmtU2PrJyHFW6eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eb40c0f2f2ce5d83707bef2f9c8259312da852d1 commit eb40c0f2f2ce5d83707bef2f9c8259312da852d1 Author: Ed Maste AuthorDate: 2022-03-02 16:40:00 +0000 Commit: Ed Maste CommitDate: 2022-03-07 16:25:21 +0000 vt_vga: fix colour in pixel blocks with more than 4 colours VGA hardware provides many different graphics and data access modes, each with different capabilities and limitations. VGA vt(4) graphics mode operates on blocks of pixels at a time. When a given pixel block contains only two colours the vt_vga driver uses write mode 3. When the block contains more than two colours it uses write mode 0. This is done because two-colour write mode 3 is much more efficient. In practice write mode 3 is used most of the time, as there is often a single foreground colour and single background colour across the entire console. One common exception requiring the use of mode 0 is when the mouse cursor is drawn over a background other than black, as we need black and white for the cursor in addition to the background colour. VGA's default 16-colour palette provides the same set of colours as the system console, but in a different order. Previously we configured a non-default VGA palette that had the same colours at the same indexes. However, this caused anything drawn before the kernel started (drawn by the loader, for instance) to change colours once the kernel configured the new, non-default palette. In 5e251aec8636 we switched to leaving the default VGA palette in place, translating console colour indexes to VGA colour indexes as necessary. This translation was missed for the write mode 0 case for pixel blocks with more than two colours. PR: 261751 Reviewed by: adrian MFC after: 1 week Fixes: 5e251aec8636 ("vt(4): Use default VGA palette") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34412 (cherry picked from commit f266082f113a6a110c28034c64693c2cc216fd9d) --- sys/dev/vt/hw/vga/vt_vga.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c index c0d001d09659..bac8f3eb7b97 100644 --- a/sys/dev/vt/hw/vga/vt_vga.c +++ b/sys/dev/vt/hw/vga/vt_vga.c @@ -582,7 +582,8 @@ vga_bitblt_pixels_block_ncolors(struct vt_device *vd, const uint8_t *masks, /* The pixel "j" uses color "color". */ for (plane = 0; plane < 4; ++plane) planes[i * 4 + plane] |= - ((color >> plane) & 0x1) << (7 - j); + ((cons_to_vga_colors[color] >> + plane) & 0x1) << (7 - j); } } }