[PATCH] support for 30 bit depth in dummy driver

Antoine Martin antoine at nagafix.co.uk
Tue Sep 20 15:45:19 UTC 2016


This patch makes it possible to start the server using the dummy
driver with a 30 bit depth.
The colormap size is changed from 256 to 1024 to prevent crashes.

This updated patch adds the missing header file to the commit.

Signed-off-by: Antoine Martin <antoine at nagafix.co.uk>
---
 src/dummy.h        | 2 +-
 src/dummy_driver.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/dummy.h b/src/dummy.h
index c3fdd6e..0dd8906 100644
--- a/src/dummy.h
+++ b/src/dummy.h
@@ -68,7 +68,7 @@ typedef struct dummyRec
     int overlay_offset;
     int videoKey;
     int interlace;
-    dummy_colors colors[256];
+    dummy_colors colors[1024];
     pointer* FBBase;
     Bool        (*CreateWindow)() ;     /* wrapped CreateWindow */
     Bool prop;
diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index 737f11c..c84000f 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -313,6 +313,7 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
 	case 15:
 	case 16:
 	case 24:
+        case 30:
 	    break;
 	default:
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -327,8 +328,8 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
 	pScrn->rgbBits = 8;
 
     /* Get the depth24 pixmap format */
-    if (pScrn->depth == 24 && pix24bpp == 0)
-	pix24bpp = xf86GetBppFromDepth(pScrn, 24);
+    if (pScrn->depth >= 24 && pix24bpp == 0)
+	pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth);
 
     /*
      * This must happen after pScrn->display has been set because
@@ -637,7 +638,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
     if(!miCreateDefColormap(pScreen))
 	return FALSE;
 
-    if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
+    if (!xf86HandleColormaps(pScreen, 1024, pScrn->rgbBits,
                          DUMMYLoadPalette, NULL, 
                          CMAP_PALETTED_TRUECOLOR 
 			     | CMAP_RELOAD_ON_MODE_SWITCH))
-- 
2.7.4



More information about the xorg-devel mailing list