[PATCHES] improve gamma support for randr-1.2 drivers

Dan Nicholson dbn.lists at gmail.com
Wed Dec 17 09:00:32 PST 2008


On Tue, Dec 16, 2008 at 1:07 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:
> These two patches should accomplish the following:
>
> - Usage of Gamma in xorg.conf will be associated with an output and set on
> the initial crtc.
>  (This should work as good as possible for clone modes, eg a non-1.0 gamma
> will not be overwritten with a standard value)
> - Gamma is stored from preinit and between server generations.
> - The old colourmap system will be disabled if gamma hook is available.
> - xrandr can now set gamma.

I'm not gonna pretend to understand all of this, but:

+Bool
+xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
+{
+    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+    xf86CrtcPtr crtc;
+    int c;
+
+    for (c = 0; c < xf86_config->num_crtc; c++) {
+        crtc = xf86_config->crtc[c];
+        if (crtc->funcs->gamma_set)
+            return TRUE;
+        else
+            return FALSE;
+    }
+
+    return FALSE;
+}

That only checks the first crtc before returning. Does that matter?

--
Dan



More information about the xorg mailing list