From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap
Date: Wed, 27 Jun 2018 14:41:24 -0400 [thread overview]
Message-ID: <CADnq5_PAsSbfZv8Zrtvc12BCfSAVxR+WB9vGyRONu7zDHnkW=w@mail.gmail.com> (raw)
In-Reply-To: <20180627163941.18737-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
On Wed, Jun 27, 2018 at 12:39 PM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@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@amd.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-06-27 18:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 16:39 [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code Michel Dänzer
[not found] ` <20180627163941.18737-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-27 16:39 ` [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap Michel Dänzer
[not found] ` <20180627163941.18737-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-27 18:41 ` Alex Deucher [this message]
2018-06-27 18:29 ` [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code Abramov, Slava
[not found] ` <CY4PR12MB13040D289B98AF5798E9C4EEFE480-rpdhrqHFk05fmUFYn07qFQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-06-28 8:26 ` Michel Dänzer
[not found] ` <f08efa46-1598-1402-2ba2-757d8bd9b841-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-28 15:38 ` Abramov, Slava
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADnq5_PAsSbfZv8Zrtvc12BCfSAVxR+WB9vGyRONu7zDHnkW=w@mail.gmail.com' \
--to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.