xserver/hw/kdrive/vesa vesa.c,1.33,1.34

Keith Packard <xserver-commit-u7BhqnqprCWvj1b/[email protected]>
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: keithp

Update of /cvs/xserver/xserver/hw/kdrive/vesa
In directory gabe:/tmp/cvs-serv28012

Modified Files:
	vesa.c 
Log Message:
Prefer 32bpp to 24bpp.  Fix 16 color planar mode (!)

Index: vesa.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/vesa/vesa.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- vesa.c	26 Jul 2004 17:14:27 -0000	1.33
+++ vesa.c	19 Jan 2005 06:35:28 -0000	1.34
@@ -403,6 +403,8 @@
     if (vabs (screen->fb[0].depth - vesaDepth (a)) < 
 	vabs (screen->fb[0].depth - vesaDepth (b)))
 	return TRUE;
+    if (a->BitsPerPixel == 32 && b->BitsPerPixel == 24)
+	return TRUE;
     return FALSE;
 }
 
@@ -845,7 +847,6 @@
 	window = vesaWindowWindowed;
 	break;
     case VESA_PLANAR:
-	pScreen->CreateColormap = vesaCreateColormap16;
 	if (pScreenPriv->screen->fb[0].bitsPerPixel == 8)
 	    update = shadowUpdatePlanar4x8;
 	else
@@ -909,7 +910,7 @@
         while (depth && !(allbits & (1 << (depth - 1))))
             depth--;
 	if (vesa_verbose)
-	    ErrorF ("\tTrue Color red 0x%x green 0x%x blue 0x%x\n",
+	    ErrorF ("\tTrue Color %d/%d red 0x%x green 0x%x blue 0x%x\n",
 		    bpp, depth, 
 		    screen->fb[0].redMask,
 		    screen->fb[0].greenMask,
@@ -1302,6 +1303,13 @@
 Bool
 vesaInitScreen(ScreenPtr pScreen)
 {
+    KdScreenPriv(pScreen);
+    VesaScreenPrivPtr	pscr = pScreenPriv->screen->driver;
+    switch (pscr->mapping) {
+    case VESA_PLANAR:
+	pScreen->CreateColormap = vesaCreateColormap16;
+	break;
+    }
     return TRUE;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.