linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Restoring Screen when coming back from KD_GRAPHICS
@ 2003-11-26  8:11 John Zielinski
  2003-12-24  8:26 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 7+ messages in thread
From: John Zielinski @ 2003-11-26  8:11 UTC (permalink / raw)
  To: linux-fbdev-devel, jsimmons

I was playing with the fbtest program and noticed some minor glitches.  
You could see corruption in the graphics where the console was still 
trying to output text from the program.  After exiting the program's 
output would mix in with the saved screen.

So I modified the fbtest program to do ioctl to KD_GRAPHICS at startup 
and KD_TEXT on exit and the graphics corruption went away.  I also 
didn't save/restore the framebuffer if we started in KD_TEXT on entry.  
This made things worse as now the graphics output was still plus the old 
text and the programs output would now appear after scrolling one line.

I checked the kernel to see why the screen wasn't being refreshed when 
switching back to KD_TEXT.   I found that if the fbdev driver has a 
blanking routine the fbcon driver doesn't do a update_screen call.  And 
the fbdev if it's using vesa blanking doesn't restore the screen nor 
does it return 1 to tell the vt driver to redraw the screen.

So here's a small patch that makes fbcon always restore the screen after 
the screen is unblanked:

diff -urNX dontdiff fbdev/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
--- fbdev/drivers/video/console/fbcon.c	2003-11-26 01:11:00.000000000 -0500
+++ linux/drivers/video/console/fbcon.c	2003-11-26 01:07:20.000000000 -0500
@@ -1688,11 +1688,13 @@
 				accel_clear(vc, info, real_y(p, 0),
 					    0, height, vc->vc_cols);
 			vc->vc_video_erase_char = oldc;
-		} else
-			update_screen(vc->vc_num);
-		return 0;
+		} 
 	} else
-		return fb_blank(info, blank);
+		fb_blank(info, blank);
+		
+	if (!blank)
+		update_screen(vc->vc_num);
+	return 0;
 }
 
 static void fbcon_free_font(struct display *p)



I think that this is the simplest way of doing it as the other two 
options would require to either change the vt driver to send a leaving 
KD_TEXT call or to change the fbcon driver to remember if each console 
was in graphics mode or not.

John





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

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

end of thread, other threads:[~2003-12-25 16:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-26  8:11 Restoring Screen when coming back from KD_GRAPHICS John Zielinski
2003-12-24  8:26 ` Benjamin Herrenschmidt
2003-12-24 22:07   ` John Zielinski
2003-12-24 22:47     ` Benjamin Herrenschmidt
2003-12-25  1:22       ` John Zielinski
2003-12-25 10:37         ` Benjamin Herrenschmidt
2003-12-25 16:28           ` John Zielinski

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