[PATCH xserver] xf86_crtc_supports_gamma: Return FALSE if RandR is disabled

Michel Dänzer michel at daenzer.net
Thu Apr 6 03:23:37 UTC 2017


From: Michel Dänzer <michel.daenzer at amd.com>

E.g. becuase Xinerama is enabled.

Fixes crash on server startup when RandR is disabled and all other
conditions in xf86_crtc_supports_gamma are satisfied.

Bugzilla: https://bugs.freedesktop.org/100293
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 hw/xfree86/modes/xf86Crtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3f9857b4a..9ce303de7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3405,7 +3405,8 @@ xf86_crtc_notify(ScreenPtr screen)
 Bool
 xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
 {
-    if (xf86CrtcConfigPrivateIndex != -1) {
+    if (dixPrivateKeyRegistered(rrPrivKey) &&
+        xf86CrtcConfigPrivateIndex != -1) {
         xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
         xf86CrtcPtr crtc;
 
-- 
2.11.0



More information about the xorg-devel mailing list