Thread (3 messages) 3 messages, 2 authors, 2003-11-28

FBTEST Patch

flat view

From: John Zielinski <hidden>
Date: 2003-11-28 02:48:02

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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help