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 <ajax@redhat.com>
This commit is contained in:
Antoine Martin 2017-08-14 12:10:32 -04:00 committed by Adam Jackson
parent 5e90221dc6
commit bc8546e2bd
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,7 @@ typedef struct dummyRec
int cursorX, cursorY; int cursorX, cursorY;
int cursorFG, cursorBG; int cursorFG, cursorBG;
dummy_colors colors[256]; dummy_colors colors[1024];
Bool (*CreateWindow)() ; /* wrapped CreateWindow */ Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop; Bool prop;
} DUMMYRec, *DUMMYPtr; } DUMMYRec, *DUMMYPtr;

View File

@ -301,6 +301,7 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
case 15: case 15:
case 16: case 16:
case 24: case 24:
case 30:
break; break;
default: default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@ -603,7 +604,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
if(!miCreateDefColormap(pScreen)) if(!miCreateDefColormap(pScreen))
return FALSE; return FALSE;
if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, if (!xf86HandleColormaps(pScreen, 1024, pScrn->rgbBits,
DUMMYLoadPalette, NULL, DUMMYLoadPalette, NULL,
CMAP_PALETTED_TRUECOLOR CMAP_PALETTED_TRUECOLOR
| CMAP_RELOAD_ON_MODE_SWITCH)) | CMAP_RELOAD_ON_MODE_SWITCH))