From ac27f8b0205837b9dd7ea0084ed68a1aa1119628 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Nov 2016 22:01:21 +0000 Subject: [PATCH] sna: Handle xf86Randr12 gamma changes in xorg-xserver-1.19 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 17213b74fd7fc4c4e2fe7a3781e7422dd482a0ab Author: Michel Dänzer Date: Tue Jun 21 16:44:20 2016 +0900 xfree86/modes: Remove xf86RandR12CrtcGetGamma removed the randr_crtc->palettes allocation and initialisation causing a later dereference of the gamma table to crash. Looks like that was just ABI misuse. References: https://bugs.freedesktop.org/show_bug.cgi?id=98855 Signed-off-by: Chris Wilson --- src/sna/sna_display_fake.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c index f0bdea6..fa26bda 100644 --- a/src/sna/sna_display_fake.c +++ b/src/sna/sna_display_fake.c @@ -96,12 +96,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } static void -sna_crtc_gamma_set(xf86CrtcPtr crtc, - CARD16 *red, CARD16 *green, CARD16 *blue, int size) -{ -} - -static void sna_crtc_destroy(xf86CrtcPtr crtc) { } @@ -109,7 +103,6 @@ sna_crtc_destroy(xf86CrtcPtr crtc) static const xf86CrtcFuncsRec sna_crtc_funcs = { .dpms = sna_crtc_dpms, .set_mode_major = sna_crtc_set_mode_major, - .gamma_set = sna_crtc_gamma_set, .destroy = sna_crtc_destroy, }; @@ -298,7 +291,8 @@ static bool add_fake_output(struct sna *sna, bool late) RRCrtcSetRotations(crtc->randr_crtc, RR_Rotate_All | RR_Reflect_All); - RRCrtcGammaGet(crtc->randr_crtc); + if (!RRCrtcGammaSetSize(crtc->randr_crtc, 256)) + goto err; } sna->mode.num_fake++; -- 2.7.4