From bc8546e2bd5ed147ed5ef18ac086a1c50caff446 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 14 Aug 2017 12:10:32 -0400 Subject: [PATCH] Support for 30 bit depth in dummy driver 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. Reviewed-by: Adam Jackson --- src/dummy.h | 2 +- src/dummy_driver.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dummy.h b/src/dummy.h index 82fbdea..8e7c43b 100644 --- a/src/dummy.h +++ b/src/dummy.h @@ -49,7 +49,7 @@ typedef struct dummyRec int cursorX, cursorY; int cursorFG, cursorBG; - dummy_colors colors[256]; + dummy_colors colors[1024]; Bool (*CreateWindow)() ; /* wrapped CreateWindow */ Bool prop; } DUMMYRec, *DUMMYPtr; diff --git a/src/dummy_driver.c b/src/dummy_driver.c index d4ac869..b4b42f7 100644 --- a/src/dummy_driver.c +++ b/src/dummy_driver.c @@ -301,6 +301,7 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags) case 15: case 16: case 24: + case 30: break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -603,7 +604,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))