From 769a959d84d7e573b11cc1a7d85c122f17dfeea0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 21 Feb 2014 13:43:09 +0000 Subject: [PATCH] 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 --- src/sna/sna_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.7.4