[PATCH] modesetting: call xf86HandleColormaps

Rinat Ibragimov ibragimovrinat at mail.ru
Sun Oct 22 22:07:44 UTC 2017


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. So I'm not sure. Is this a correct way to fix it?

---cut---
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 4d5c4e339..45a061efc 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1669,7 +1669,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
     if (!xf86CrtcScreenInit(pScreen))
         return FALSE;
 
-    if (!miCreateDefColormap(pScreen))
+    if (!drmmode_setup_colormap(pScreen, pScrn))
         return FALSE;
 
     xf86DPMSInit(pScreen, xf86DPMSSet, 0);
---cut---


---
Rinat


More information about the xorg-devel mailing list