linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FBTEST Patch
@ 2003-11-28  2:47 John Zielinski
  2003-11-28  9:21 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: John Zielinski @ 2003-11-28  2:47 UTC (permalink / raw)
  To: linux-fbdev-devel

Here's the fbtest patch I was talking about:

diff -urNX dontdiff fbtest.old/fb.c fbtest/fb.c
--- fbtest.old/fb.c	2003-04-04 07:07:55.000000000 -0500
+++ fbtest/fb.c	2003-11-27 21:41:16.000000000 -0500
@@ -18,6 +18,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <linux/kd.h>
 
 #include <asm/page.h>
 
@@ -47,6 +48,7 @@
 static struct fb_cmap saved_cmap;
 static u16 *saved_red, *saved_green, *saved_blue, *saved_transp;
 static u8 *saved_fb;
+static long old_mode;
 
 
 static void fix_validate(void);
@@ -396,6 +398,9 @@
 void fb_init(void)
 {
     Debug("fb_init()\n");
+    ioctl(STDOUT_FILENO, KDGETMODE, &old_mode);
+    if (old_mode == KD_TEXT );
+        ioctl(STDOUT_FILENO, KDSETMODE, KD_GRAPHICS);
     fb_open();
     fb_get_var();
     saved_var = fb_var;
@@ -435,7 +440,8 @@
 	    ALLOC_AND_SAVE_COMPONENT(transp);
     }
     fb_map();
-    fb_save();
+    if (old_mode == KD_GRAPHICS)
+        fb_save();
     fb_clear();
 }
 
@@ -477,6 +483,7 @@
 	/* FIXME: compare fb_fix with saved_fix */
 	fb_close();
     }
+    ioctl(STDOUT_FILENO, KDSETMODE, old_mode);
 }
 
 #undef RESTORE_AND_FREE_COMPONENT


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] 3+ messages in thread

end of thread, other threads:[~2003-11-28 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-28  2:47 FBTEST Patch John Zielinski
2003-11-28  9:21 ` Geert Uytterhoeven
2003-11-28 22:44   ` 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).