On 23.06.2016 04:58, Emil Velikov wrote: > On 22 June 2016 at 04:12, Michel Dänzer <[email protected]> wrote: >> From: Michel Dänzer <[email protected]> >> >> 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 <[email protected]> >> --- >> >> 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 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
