[PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap
Alex Deucher
alexdeucher at gmail.com
Wed Jun 27 18:41:24 UTC 2018
On Wed, Jun 27, 2018 at 12:39 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Instead of from drmmode_set_mode_major. There's no need to re-set the
> gamma LUT on every modeset, the kernel should preserve it.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> src/drmmode_display.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 5fe49b607..9364a885a 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1353,12 +1353,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
> else
> drmmode_crtc->scanout_id = 0;
>
> - /* 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,
> &fb, &x, &y);
> @@ -3450,6 +3444,7 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
> Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
> {
> xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> + int i;
>
> if (xf86_config->num_crtc) {
> xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
> @@ -3457,13 +3452,23 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
> if (!miCreateDefColormap(pScreen))
> return FALSE;
> /* 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
> - | CMAP_RELOAD_ON_MODE_SWITCH))
> - return FALSE;
> + if (pScrn->depth != 30) {
> + if (!xf86HandleColormaps(pScreen, 256, 10, NULL, NULL,
> + CMAP_PALETTED_TRUECOLOR
> + | CMAP_RELOAD_ON_MODE_SWITCH))
> + return FALSE;
> +
> + for (i = 0; i < xf86_config->num_crtc; i++) {
> + xf86CrtcPtr crtc = xf86_config->crtc[i];
> +
> + drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red,
> + crtc->gamma_green,
> + crtc->gamma_blue,
> + crtc->gamma_size);
> + }
> + }
> }
> +
> return TRUE;
> }
>
> --
> 2.18.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list