From: Chris Wilson Date: Fri, 21 Feb 2014 13:43:09 +0000 (+0000) Subject: sna: Do not register colormaps without any CRTCs X-Git-Tag: 2.99.911~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=769a959d84d7e573b11cc1a7d85c122f17dfeea0;p=platform%2Fupstream%2Fxf86-video-intel.git sna: Do not register colormaps without any CRTCs The xserver may crash if we try to setup colormap handling without any CRTCs, so don't. Suggested-by: Dave Airlie Signed-off-by: Chris Wilson --- diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 01d34f8..ef30149 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -1038,11 +1038,11 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL) if (!miCreateDefColormap(screen)) return FALSE; - if (!xf86HandleColormaps(screen, 256, 8, sna_load_palette, NULL, + if (sna->mode.kmode->count_crtcs && + !xf86HandleColormaps(screen, 256, 8, sna_load_palette, NULL, CMAP_RELOAD_ON_MODE_SWITCH | - CMAP_PALETTED_TRUECOLOR)) { + CMAP_PALETTED_TRUECOLOR)) return FALSE; - } xf86DPMSInit(screen, xf86DPMSSet, 0);