xserver: Branch 'master' - 2 commits

Matthew Allum mallum at kemper.freedesktop.org
Sat Jul 8 23:14:42 EEST 2006


 hw/kdrive/ephyr/ephyr.c     |   22 +++++++++++++++-------
 hw/kdrive/ephyr/ephyrinit.c |    7 +++++++
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
diff-tree 21e3e3ca298dce22e5fad6ef38aa6fe9736a1d3b (from parents)
Merge: e8056218944e873135c93039d1e9646d51364467 39b2f7b2182aedb1ab45415efb4c263012ace512
Author: Matthew Allum <mallum at polystyrene.(none)>
Date:   Sat Jul 8 21:13:52 2006 +0100

    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver

diff-tree e8056218944e873135c93039d1e9646d51364467 (from 5416f90e9c939027005fc01fa3ce3df56919ae0d)
Author: Matthew Allum <mallum at polystyrene.(none)>
Date:   Sat Jul 8 21:10:58 2006 +0100

    Add support to Xephyr for simulating 8bit grayscale.

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index a9ea0eb..fbb16a4 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -40,6 +40,8 @@ extern DeviceIntPtr pKdKeyboard;
 
 static int mouseState = 0;
 
+Bool   EphyrWantGrayScale = 0;
+
 Bool
 ephyrInitialize (KdCardInfo *card, EphyrPriv *priv)
 {
@@ -80,7 +82,10 @@ ephyrScreenInitialize (KdScreenInfo *scr
       screen->width = width;
       screen->height = height;
     }
-  
+
+  if (EphyrWantGrayScale)
+    screen->fb[0].depth = 8;
+
   if (screen->fb[0].depth && screen->fb[0].depth != hostx_get_depth())
     {
       if (screen->fb[0].depth < hostx_get_depth()
@@ -98,12 +103,15 @@ ephyrScreenInitialize (KdScreenInfo *scr
   
   if (screen->fb[0].depth <= 8)
     {
-      screen->fb[0].visuals = ((1 << StaticGray) |
-			       (1 << GrayScale) |
-			       (1 << StaticColor) |
-			       (1 << PseudoColor) |
-			       (1 << TrueColor) |
-			       (1 << DirectColor));
+      if (EphyrWantGrayScale)
+	screen->fb[0].visuals = ((1 << StaticGray) | (1 << GrayScale));
+      else
+	screen->fb[0].visuals = ((1 << StaticGray) |
+				 (1 << GrayScale) |
+				 (1 << StaticColor) |
+				 (1 << PseudoColor) |
+				 (1 << TrueColor) |
+				 (1 << DirectColor));
       
       screen->fb[0].redMask   = 0x00;
       screen->fb[0].greenMask = 0x00;
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 58478e6..1aa608e 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -29,6 +29,7 @@
 #include "ephyr.h"
 
 extern Window EphyrPreExistingHostWin;
+extern Bool   EphyrWantGrayScale;
 
 void
 InitCard (char *name)
@@ -62,6 +63,7 @@ ddxUseMsg (void)
   ErrorF("-parent XID   Use existing window as Xephyr root win\n");
   ErrorF("-host-cursor  Re-use exisiting X host server cursor\n");
   ErrorF("-fullscreen   Attempt to run Xephyr fullscreen\n");
+  ErrorF("-grayscale    Simulate 8bit grayscale\n");
   ErrorF("-fakexa	Simulate acceleration using software rendering\n");
   ErrorF("\n");
 
@@ -94,6 +96,11 @@ ddxProcessArgument (int argc, char **arg
       hostx_use_fullscreen();
       return 1;
     }
+  else if (!strcmp (argv[i], "-grayscale"))
+    {
+      EphyrWantGrayScale = 1;      
+      return 1;
+    }
   else if (!strcmp (argv[i], "-fakexa"))
     {
       ephyrFuncs.initAccel = ephyrDrawInit;



More information about the xorg-commit mailing list