From: Qiang Yu <Qiang.Yu@xxxxxxx> gamma set is disabled in kernel driver when deep color. Enable it will confuse the user. Signed-off-by: Qiang Yu <Qiang.Yu at amd.com> [ Michel Dänzer: Align drmmode_pre_init change with radeon commit 1f1d4b1fa7d4b22dd8553f7e71251bf17ca7a7b1 ] Signed-off-by: Michel Dänzer <michel.daenzer at amd.com> --- src/drmmode_display.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index be3deef20..e52b7a355 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -858,8 +858,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, if (drmmode_crtc->tear_free) scanout_id = drmmode_crtc->scanout_id; - drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); + /* gamma is disabled in kernel driver for deep color */ + if (pScrn->depth != 30) + drmmode_crtc_gamma_do_set( + crtc, crtc->gamma_red, crtc->gamma_green, + crtc->gamma_blue, crtc->gamma_size); if (drmmode_crtc->prime_scanout_pixmap) { drmmode_crtc_prime_scanout_update(crtc, mode, scanout_id, @@ -2361,6 +2364,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; + for (i = 0; i < mode_res->count_crtcs; i++) if (!xf86IsEntityShared(pScrn->entityList[0]) || (crtcs_needed && !(pAMDGPUEnt->assigned_crtcs & (1 << i)))) @@ -2591,8 +2600,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) "Initializing kms color map\n"); if (!miCreateDefColormap(pScreen)) return FALSE; - /* all amdgpus 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 at suse.de) */ -- 2.16.1