linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 2.6.15-rc4-git1] Fix switching to KD_TEXT
@ 2005-12-08 22:49 Knut Petersen
  2005-12-09  0:24 ` Antonino A. Daplas
  2005-12-10  6:28 ` Knut Petersen
  0 siblings, 2 replies; 9+ messages in thread
From: Knut Petersen @ 2005-12-08 22:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-fbdev-devel, Andrew Morton, Antonino A. Daplas

  Every framebuffer driver relies on the assumption that the set_par() 
function
of the driver is called before drawing functions and other functions 
dependent
on the hardware state are executed.

This assumption is false in two cases, and one is a genuine linux
bug:

    1: Whenever you switch from X to a framebuffer console for the very
        first time, there is a chance that a broken X system has _not_ set
        the mode to KD_GRAPHICS, thus the vt and framebuffer code
        executes a screen redraw and several other functions before a
        set_par() is executed. This is believed to be not a bug of linux
        but a bug of X/xdm.

    2: Whenever a switch from X to a framebuffer console occures,
         the pan_display() function of the driver is called once before
         the set_par() function of the driver is called. Code path:
         complete_change_console -> redraw_screen -> fbcon_switch ->
         bit_update_start-> fb_pan_display -> xyz_pan_display.
         This is clearly a bug of linux.

Although our primary goal must be to fix linux bugs and not to work
around bugs of X, the patch fixes both of the cases.

The advantage and correctness of this patch should be obvious. Yes, it
does add a possibly slow call to the fb_set_par() function, but at this
point it is necessary.

Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de>


diff -uprN -X linux/Documentation/dontdiff -x '*.bak' -x '*.ctx' linuxorig/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
--- linuxorig/drivers/video/console/fbcon.c	2005-12-02 12:18:04.000000000 +0100
+++ linux/drivers/video/console/fbcon.c	2005-12-06 09:06:56.000000000 +0100
@@ -2103,10 +2103,11 @@ static int fbcon_switch(struct vc_data *
 	fb_set_var(info, &var);
 	ops->var = info->var;
 
-	if (old_info != NULL && old_info != info) {
-		if (info->fbops->fb_set_par)
-			info->fbops->fb_set_par(info);
+	if (old_info != NULL && old_info != info)
 		fbcon_del_cursor_timer(old_info);
+
+	if (info->fbops->fb_set_par) {
+		info->fbops->fb_set_par(info);
 		fbcon_add_cursor_timer(info);
 	}




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-12-10  6:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-08 22:49 [PATCH 1/1 2.6.15-rc4-git1] Fix switching to KD_TEXT Knut Petersen
2005-12-09  0:24 ` Antonino A. Daplas
2005-12-09 11:53   ` Knut Petersen
2005-12-09 14:14     ` Ville Syrjälä
2005-12-09 20:35       ` Knut Petersen
2005-12-10  5:33         ` Antonino A. Daplas
2005-12-09 14:33     ` Antonino A. Daplas
2005-12-09 16:38     ` Antonino A. Daplas
2005-12-10  6:28 ` Knut Petersen

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).