public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Uma Shankar <uma.shankar@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: ville.syrjala@intel.com, maarten.lankhorst@intel.com
Subject: [v6 1/6] drm/i915: Sanitize crtc gamma and csc mode
Date: Wed, 16 Jan 2019 21:51:32 +0530	[thread overview]
Message-ID: <1547655697-4092-2-git-send-email-uma.shankar@intel.com> (raw)
In-Reply-To: <1547655697-4092-1-git-send-email-uma.shankar@intel.com>

Sanitize crtc gamma and csc  mode and update the mode in driver
in case BIOS has setup a different mode or gamma luts, csc  with
any other unexpected values than desired. There is restriction on
HSW platform not to read/write color LUT's if ips is enabled.
Handled the same accordingly.

We don't read out the LUT's and CTM that the BIOS setup, so at the
moment they stick around for a while until they get unexpectedly
clobbered by a subsequent modeset or fastset. The change here will
basically force them to be reset to standard/linear values at startup.

Maybe in the future we'll try to actually read out and preserve the
contents of the actual LUT's and CTM that the BIOS had setup, but we
don't do that yet today, so the change here at least makes the behavior
a little bit more consistent than what it has been.

v2: Addressed Matt's review comments.

Credits-to: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index af164d7..56fa469 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15434,6 +15434,27 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
 		}
 	}
 
+	/*
+	 * Sanitize gamma mode incase BIOS leaves it in SPLIT GAMMA MODE
+	 * or gamma luts, csc  with any other unexpected values than desired.
+	 * We don't read out the LUT's and CTM that the BIOS setup, so at the
+	 * moment they stick around for a while until they get unexpectedly
+	 * clobbered by a subsequent modeset or fastset.
+	 * The change here will basically force them to be reset to
+	 * standard/linear values at startup.
+	 * Workaround HSW : Do not read or write the pipe palette/gamma data
+	 * while GAMMA_MODE is configured for split gamma and IPS_CTL has IPS
+	 * enabled.
+	 */
+	if (IS_HASWELL(dev_priv)) {
+		hsw_disable_ips(crtc_state);
+
+		intel_color_set_csc(crtc_state);
+		intel_color_load_luts(crtc_state);
+
+		hsw_enable_ips(crtc_state);
+	}
+
 	/* Adjust the state of the output pipe according to whether we
 	 * have active connectors/encoders. */
 	if (crtc_state->base.active && !intel_crtc_has_encoders(crtc))
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-01-16 15:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 16:21 [v6 0/6] Add support for Gen 11 pipe color features Uma Shankar
2019-01-16 16:21 ` Uma Shankar [this message]
2019-01-16 16:21 ` [v6 2/6] drm/i915/glk: Fix degamma lut programming Uma Shankar
2019-01-28 21:34   ` Matt Roper
2019-01-16 16:21 ` [v6 3/6] drm/i915/icl: Add icl pipe degamma and gamma support Uma Shankar
2019-01-28 22:19   ` Matt Roper
2019-01-29 15:36     ` Shankar, Uma
2019-01-16 16:21 ` [v6 4/6] drm/i915/icl: Enable ICL Pipe CSC block Uma Shankar
2019-01-28 22:19   ` Matt Roper
2019-01-29 15:38     ` Shankar, Uma
2019-01-16 16:21 ` [v6 5/6] drm/i915/icl: Enable pipe output csc Uma Shankar
2019-01-28 22:19   ` Matt Roper
2019-01-29 15:52     ` Shankar, Uma
2019-01-16 16:21 ` [v6 6/6] drm/i915/icl: Add degamma and gamma lut size to gen11 caps Uma Shankar
2019-01-17  8:55 ` ✗ Fi.CI.CHECKPATCH: warning for Add support for Gen 11 pipe color features (rev6) Patchwork
2019-01-17  9:39 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-17 13:31 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-25 12:35 ` [v6 0/6] Add support for Gen 11 pipe color features Shankar, Uma

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=1547655697-4092-2-git-send-email-uma.shankar@intel.com \
    --to=uma.shankar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@intel.com \
    --cc=ville.syrjala@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox