linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Zielinski <grim@undead.cc>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: FBTEST Patch
Date: Thu, 27 Nov 2003 21:47:45 -0500	[thread overview]
Message-ID: <3FC6B751.8080801@undead.cc> (raw)

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/

             reply	other threads:[~2003-11-28  2:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-28  2:47 John Zielinski [this message]
2003-11-28  9:21 ` FBTEST Patch Geert Uytterhoeven
2003-11-28 22:44   ` John Zielinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FC6B751.8080801@undead.cc \
    --to=grim@undead.cc \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).