From nobody Mon Mar 07 16:26:13 2022 X-Original-To: dev-commits-src-all@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 EC20219FF8BB; Mon, 7 Mar 2022 16:26:14 +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 4KC3jy29ZHz4b7Y; Mon, 7 Mar 2022 16:26:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646670374; 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=ObhkSPumLY49I3lH7I4TLSZaOJ3sDsxUDSfnF1stdkc=; b=BB6NnlrbjYfg0dLARkOMP2qm3+v+vKthnHZ6SORiQe0H4lUzwOdMuWMv6BUYTKso8Sotmh cGPu+2S9JcdOnfqMhrUVCLhmlCYStNdvlZCvQCLEIjjVWBH5yHxSpDL9rRbHvmX0Znd4eP T7EZbiZ86vbStM6vsq1BCrPuB5fOICb4hRj5+fsFPgHgkX7wKx5rvM4IaIEPDvx1f8Yusg gKjWtuD8PTf1hEI+IWGYBfHh8Y9xfz36+uZ7udtEsFv0CfOY+ovOhDFeAvkv91mH4VJWsq 6uDe3YdrLIaJLFjkU5ilMd3Zhay5lNcDCNwdrQ9r5Yld6CkvpOZL6P1TTrJEvQ== 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 1B9AC392E; Mon, 7 Mar 2022 16:26:14 +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 227GQE3I004300; Mon, 7 Mar 2022 16:26:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 227GQDDM004299; Mon, 7 Mar 2022 16:26:13 GMT (envelope-from git) Date: Mon, 7 Mar 2022 16:26:13 GMT Message-Id: <202203071626.227GQDDM004299@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: 4e4e477d89fd - stable/12 - vt_vga: fix colour in pixel blocks with more than 4 colours List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/12 X-Git-Reftype: branch X-Git-Commit: 4e4e477d89fd0333425ed4623858082bdb58ffe7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646670374; 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=ObhkSPumLY49I3lH7I4TLSZaOJ3sDsxUDSfnF1stdkc=; b=cu55Mru1QvzcWLFPwvVCgaXuJf7vvY4JoAc+YsRSLc9rBNwuPLdyg9/tdmbwBpt+lFxGvP T1aKIqrDaSTl7vN6+smfzRlejbTyYSHQc5799hDXAw9AQtj+6ErQ7N0rv9dxtqeWp/mqYS N6DWwB8JkPgH56E5+ZmCWGFBf4WYcU4g5P5gzIVSqp8LOoOHVkK5NqsB4Grl02pzGvdXyg acqSmCI+AJj5uHMkqAWHxvb+Ew00FsaKQtiw0tPjFOMFVc0XZZvZ+tt2FhJofK0s5zQeVi DERqlrDtLstPgHrYSVH32tf5d5y4/ME45q4qgE+wyKkzY7mZhETRpMUYMlBXjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646670374; a=rsa-sha256; cv=none; b=dfS8EWENTabag7eHWJovrkFnZVgUFrgkgd7pj0mtb1G//26Hu+ZvouzaSf9Q8SBvJ81bj4 2Jc+m0wiCf/Ms2x19CQLz2Av7p16GDvhjiDrYtDYF24U5ZQb/uKikXRSP7+jCcHMo4GsZ5 xW4O4YIyilXJ8N0pK2LJWgVgj5fkF2t37cM1PHAntwfwuBwrPy8gbKiHJdhaITjt/QjnMc qtTyyAjP7hDVqd5S9GXkyfk7Cr+XwacamhZMuu9igJ55nf+hlb9uhjoRu2QjcWqZFUf4qY JqiT+jLXUZRXmP8YioeV32EZgtiaa/aavhPM1QrWTHlZgh5sEzAHpK3LYtp1Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4e4e477d89fd0333425ed4623858082bdb58ffe7 commit 4e4e477d89fd0333425ed4623858082bdb58ffe7 Author: Ed Maste AuthorDate: 2022-03-02 16:40:00 +0000 Commit: Ed Maste CommitDate: 2022-03-07 16:25:58 +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); } } }