[PATCH] modesetting: call xf86HandleColormaps
Michel Dänzer
michel at daenzer.net
Mon Oct 23 10:55:57 UTC 2017
On 23/10/17 12:07 AM, Rinat Ibragimov wrote:
> Long ago, it was possible to apply color profile with modesetting driver.
> But it's not working now. (Stopped approximately after 1.19.0 release).
> Bisecting points to the patch b4e46c04 (xfree86: Hook up colormaps and
> RandR 1.2 gamma code v6). Applying color profile still works with intel
> driver.
>
> As far as I understand, it was working because there were fall-backs which
> were removed by the patch b4e46c04. And now, since modesetting does not
> provide LoadPalette method, fails. Fortunately, there is
> drmmode_setup_colormap(), which in turn calls xf86HandleColormaps().
>
> Patch below works on my machine. "xcalib -i -a" inverts colors as before.
> Applying .icc file also changes colors as expected. But this colormap
> handling surely has pitfalls.
What would those pitfalls be?
Before the change above, X11 colormaps weren't applied at all with a
RandR 1.2 capable driver, effectively always using a no-op mapping
instead (and completely breaking depth 8 pseudocolour). Also, the gamma
values managed via RandR 1.2 and other methods weren't integrated with
each other, changing either clobbered the hardware gamma values from the
other one.
Now, all of those things are fixed, the colormap and various gamma
values are correctly combined with each other.
> So I'm not sure. Is this a correct way to fix it?
Yes, it is.
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list