[PATCH v3 xserver 3/3] xfree86: Hook up colormaps and RandR 1.2 gamma code

Emil Velikov emil.l.velikov at gmail.com
Wed Jun 22 19:58:22 UTC 2016


Hi Michel,

On 22 June 2016 at 04:12, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Instead of breaking the former when the driver supports the latter,
> hook them up so that the hardware LUTs reflect the combination of the
> current colourmap and gamma states. I.e. combine the colourmap, the
> global gamma value/ramp and the RandR 1.2 per-CRTC gamma ramps into one
> combined LUT per CRTC.
>
> Fixes e.g. gamma sliders not working in games.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27222
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> v3: Free randrp->palette in xf86RandR12CloseScreen, fixes memory leak.
>
There's one more leak in the (annoying to debug) error path.


> @@ -193,7 +187,12 @@ xf86HandleColormaps(ScreenPtr pScreen,
>      pScreen->InstallColormap = CMapInstallColormap;
>      pScreen->StoreColors = CMapStoreColors;
>
> -    pScrn->LoadPalette = loadPalette;
> +    if (xf86_crtc_supports_gamma(pScrn)) {
> +        pScrn->LoadPalette = xf86RandR12LoadPalette;
> +        if (!xf86RandR12InitGamma(pScrn, elements))
Here we leak and more importantly forget to unwrap. Calling
CMapUnwrapScreen() should suffice ?

Regards,
Emil


More information about the xorg-devel mailing list