[v5 1/5] drm/i915: Sanitize crtc gamma mode

Uma Shankar uma.shankar at intel.com
Thu Dec 27 18:07:19 UTC 2018


Sanitize crtc gamma mode and update the mode in driver in case
BIOS has setup a different gamma mode as to what is expected by
driver.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3b70948..f707c99 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15376,6 +15376,20 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
 		}
 	}
 
+	/*
+	 * Sanitize gamma mode incase BIOS leaves it in SPLIT GAMMA MODE
+	 * Workaround : 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 (crtc_state->ips_enabled)
+		hsw_disable_ips(crtc_state);
+
+	intel_color_set_csc(crtc_state);
+	intel_color_load_luts(crtc_state);
+
+	if (crtc_state->ips_enabled)
+		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



More information about the Intel-gfx-trybot mailing list