From e73cdba865f36ebf78c2dc4ff674b4d9bfe85013 Mon Sep 17 00:00:00 2001 From: Kevin E Martin Date: Mon, 7 Nov 2005 21:03:49 +0000 Subject: [PATCH] Fix Xvfb to work properly in depth 15 mode. Fixes XTS5 XCloseDisplay-3 server crash. --- hw/vfb/InitOutput.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index ae3db3f4e..630d3e133 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -698,12 +698,11 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) /* Calculate how many entries in colormap. This is rather bogus, because * the visuals haven't even been set up yet, but we need to know because we - * have to allocate space in the file for the colormap. The number 15 - * below comes from the detail that the size of a colormap is limited to - * 15bits. + * have to allocate space in the file for the colormap. The number 10 + * below comes from the MAX_PSEUDO_DEPTH define in cfbcmap.c. */ - if (pvfb->depth <= 15) + if (pvfb->depth <= 10) { /* single index colormaps */ pvfb->ncolors = 1 << pvfb->depth; } @@ -908,9 +907,7 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) #endif case 15: miSetVisualTypesAndMasks (15, - ((1 << GrayScale) | - (1 << PseudoColor) | - (1 << TrueColor) | + ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0x7c00, 0x03e0, 0x001f); break;