[PATCH] fix text console redrawing
From: Paul Mackerras <hidden>
Date: 2002-12-12 03:37:42
Also in:
lkml
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) {