From: Zsolt Kajtar <soci@c64.rulez.org>
To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: Zsolt Kajtar <soci@c64.rulez.org>
Subject: [PATCH v2 3/4] tty/vt: Fix unreadable kernel messages on vgacon
Date: Mon, 1 Sep 2025 07:26:35 +0200 [thread overview]
Message-ID: <20250901052636.8981-4-soci@c64.rulez.org> (raw)
In-Reply-To: <20250901052636.8981-1-soci@c64.rulez.org>
When a 512 glyph font is loaded on vgacon and the bold attributes are in
effect then the kernel console output (printk) becomes unreadable. It is
because the brightness bit (used for bold) is at the same place where
the 8th bit of the glyph index is. This patch adds the missing masking
to ensure the output will be displayed using the lower half of the font.
Signed-off-by: Zsolt Kajtar <soci@c64.rulez.org>
---
drivers/tty/vt/vt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 27b1afd5d..5d458211b 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3361,7 +3361,8 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
continue;
}
vc_uniscr_putc(vc, c);
- scr_writew((vc->vc_attr << 8) + c, (unsigned short *)vc->vc_pos);
+ scr_writew(((vc->vc_attr << 8) & ~vc->vc_hi_font_mask) | c,
+ (unsigned short *)vc->vc_pos);
notify_write(vc, c);
cnt++;
if (vc->state.x == vc->vc_cols - 1) {
--
2.30.2
next prev parent reply other threads:[~2025-09-01 5:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 5:26 [PATCH v2 0/4] tty/vt: fix various 512 glyph font issues Zsolt Kajtar
2025-09-01 5:26 ` [PATCH v2 1/4] tty/vt: 8th bit location in vc_uniscr routines Zsolt Kajtar
2025-09-01 5:26 ` [PATCH v2 2/4] tty/vt: Prevent 8th bit corruption with soft cursor Zsolt Kajtar
2025-09-01 5:26 ` Zsolt Kajtar [this message]
2025-09-01 5:26 ` [PATCH v2 4/4] tty/vt: use correct attribute mask in do_update_region Zsolt Kajtar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250901052636.8981-4-soci@c64.rulez.org \
--to=soci@c64.rulez.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).