[PATCH v3 xserver 3/3] xfree86: Hook up colormaps and RandR 1.2 gamma code
Michel Dänzer
michel at daenzer.net
Thu Jun 23 03:40:47 UTC 2016
On 23.06.2016 04:58, Emil Velikov wrote:
> 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 ?
Thanks for the review, fixed in v4.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list