[PATCH] fix text console redrawing

Paul Mackerras (paulus@samba.org)
Thu, 12 Dec 2002 14:35:47 +1100


I found out why the text console wasn't getting redrawn when switching
from X back to tty1. It was because the vc->vc_font.width and .height
for tty1 had been reset to 0 by fbcon_set_display(). The font-setting
logic in there looks wrong to me, and this patch should fix it.
Without this patch, we find the first console on this fb which appears
to have valid font data and then copy the width and height *to* that
console rather than *from* that console. This patch changes it to
copy from that console to the new console that we are initializing.

Paul.

diff -urN linux-2.5/drivers/video/console/fbcon.c pmac-2.5/drivers/video/console/fbcon.c
--- linux-2.5/drivers/video/console/fbcon.c 2002-12-10 15:20:32.000000000 +1100
+++ pmac-2.5/drivers/video/console/fbcon.c 2002-12-12 13:46:21.000000000 +1100
@@ -926,11 +926,11 @@
struct display *q = &fb_display[i];
struct vc_data *tmp = vc_cons[i].d;

- if (fontwidthvalid(p, vc->vc_font.width)) {
+ if (!fontwidthvalid(p, vc->vc_font.width)) {
/* If we are not the first console on this
fb, copy the font from that console */
- tmp->vc_font.width = vc->vc_font.width;
- tmp->vc_font.height = vc->vc_font.height;
+ vc->vc_font.width = tmp->vc_font.width;
+ vc->vc_font.height = tmp->vc_font.height;
p->fontdata = q->fontdata;
p->userfont = q->userfont;
if (p->userfont) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/