diff options
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 217e01c75..30308ade4 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -3155,15 +3155,19 @@ xf86_crtc_notify(ScreenPtr screen) Bool xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86CrtcPtr crtc; + if (xf86CrtcConfigPrivateIndex != -1) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcPtr crtc; - if ((xf86CrtcConfigPrivateIndex == -1) || !xf86_config) - return FALSE; + if (!xf86_config) + return FALSE; - if (xf86_config->num_crtc == 0) - return FALSE; - crtc = xf86_config->crtc[0]; + if (xf86_config->num_crtc == 0) + return FALSE; + crtc = xf86_config->crtc[0]; - return (crtc->funcs->gamma_set != NULL); + return (crtc->funcs->gamma_set != NULL); + } + + return FALSE; } |