The hardware gamma luts get bypassed at color
depth 30 anyway, so skip their setup.

v2: Also don't hook up drmmode_crtc_gamma_set()
    to .gamma_set for a screen with depth 30,
    so the server can spare itself the effort of
    updating and setting unused cluts.
    Suggested by Michel.

Signed-off-by: Mario Kleiner <[email protected]>
---
 src/drmmode_display.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b1c874c..21cc3c9 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2544,6 +2544,12 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, int cpp)
                info->drmmode_crtc_funcs.shadow_destroy = NULL;
        }
 
+       /* Hw gamma lut's are currently bypassed by the hw at color depth 30,
+        * so spare the server the effort to compute and update the cluts.
+        */
+       if (pScrn->depth == 30)
+               info->drmmode_crtc_funcs.gamma_set = NULL;
+
        drmmode->count_crtcs = mode_res->count_crtcs;
        xf86CrtcSetSizeRange(pScrn, 320, 200, mode_res->max_width, 
mode_res->max_height);
 
@@ -2787,8 +2793,10 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, 
ScrnInfoPtr pScrn)
                       "Initializing kms color map\n");
        if (!miCreateDefColormap(pScreen))
            return FALSE;
-       /* all radeons support 10 bit CLUTs */
-       if (!xf86HandleColormaps(pScreen, 256, 10,
+
+       /* All radeons support 10 bit CLUTs. They get bypassed at depth 30. */
+       if (pScrn->depth != 30 &&
+           !xf86HandleColormaps(pScreen, 256, 10,
                                 NULL, NULL,
                                 CMAP_PALETTED_TRUECOLOR
 #if 0 /* This option messes up text mode! ([email protected]) */
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to