All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-ati 18/21] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap
Date: Wed, 11 Jul 2018 19:28:03 +0200	[thread overview]
Message-ID: <20180711172806.22849-19-michel@daenzer.net> (raw)
In-Reply-To: <20180711172806.22849-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>

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.

(Ported from amdgpu commit baea4fa492f635cdfe746a84be2e337d9aeae8a9)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/drmmode_display.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e301c0e6b..03c850f8a 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -887,9 +887,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		else
 			drmmode_crtc->scanout_id = 0;
 
-		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);
@@ -2854,6 +2851,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, RADEON_LOGLEVEL_DEBUG,
@@ -2862,13 +2860,23 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 	    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

  parent reply	other threads:[~2018-07-11 17:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 17:27 [PATCH xf86-video-ati 00/21] Port outstanding changes frm Michel Dänzer
     [not found] ` <20180711172806.22849-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-11 17:27   ` [PATCH xf86-video-ati 01/21] Wait for pending scanout update before calling drmmode_crtc_scanout_free Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 02/21] Do not export the DriverRec RADEON Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 03/21] Ignore RADEON_DRM_QUEUE_ERROR (0) in radeon_drm_abort_entry Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 04/21] Track DRM event queue sequence number in scanout_update_pending Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 05/21] Abort scanout_update_pending event when possible Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 06/21] Update RandR CRTC state if set_mode_major fails in set_desired_modes Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 07/21] Simplify drmmode_crtc_scanout_update Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 08/21] Don't call scanout_flip/update with a legacy RandR scanout buffer Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 09/21] Simplify drmmode_handle_transform Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 10/21] Set drmmode_crtc->scanout_id = 0 when TearFree is disabled Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 11/21] Refactor drmmode_output_set_tear_free helper Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 12/21] Wait for pending flips in drmmode_output_set_tear_free Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 13/21] Replace 'foo == NULL' with '!foo' Michel Dänzer
2018-07-11 17:27   ` [PATCH xf86-video-ati 14/21] Call drmmode_do_crtc_dpms from drmmode_crtc_dpms as well Michel Dänzer
2018-07-11 17:28   ` [PATCH xf86-video-ati 15/21] Use drmmode_crtc_dpms in drmmode_set_desired_modes Michel Dänzer
2018-07-11 17:28   ` [PATCH xf86-video-ati 16/21] Check dimensions passed to drmmode_xf86crtc_resize Michel Dänzer
2018-07-11 17:28   ` [PATCH xf86-video-ati 17/21] Remove #if 0'd code Michel Dänzer
2018-07-11 17:28   ` Michel Dänzer [this message]
2018-07-11 17:28   ` [PATCH xf86-video-ati 19/21] modesetting: Record non-desktop kernel property at PreInit time Michel Dänzer
2018-07-11 17:28   ` [PATCH xf86-video-ati 20/21] modesetting: Create CONNECTOR_ID properties for outputs [v2] Michel Dänzer
2018-07-11 17:28   ` [PATCH xf86-video-ati 21/21] Add RandR leases support Michel Dänzer
2018-07-12  4:48   ` [PATCH xf86-video-ati 00/21] Port outstanding changes frm Alex Deucher

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=20180711172806.22849-19-michel@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.