modes: Protect xf86_crtc_supports_gamma() from non-RandR 1.2 drivers.

This commit is contained in:
Eric Anholt 2009-01-30 20:10:21 -08:00
parent 317f2b4a9f
commit f716e3f344

View File

@ -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;
}