diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2018-01-22 03:14:35 +0100 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2018-01-22 12:08:42 +0100 |
commit | 1f1d4b1fa7d4b22dd8553f7e71251bf17ca7a7b1 (patch) | |
tree | b190df5af3f4f5ef5de5ef58db5c223186ce0217 /src | |
parent | 21f6753462464acfd3c452393328c977a375ce26 (diff) |
Skip xf86HandleColormaps() at color depth 30. (v2)
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 <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index b1c874c7..21cc3c90 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! (eich@suse.de) */ |