[Intel-gfx] [PATCH] drm/i915/color: fix broken display in icl+

Swati Sharma swati2.sharma at intel.com
Tue Oct 1 06:31:28 UTC 2019


Premature gamma lut prepration and loading which was getting
reflected in first modeset causing different colors on
screen during boot.

Issue: In BIOS, gamma is disabled by default. However,
legacy_read_luts() was getting called even before the legacy_load_luts()
which was setting crtc_state->base.gamma_lut and gamma_lut was
programmed with junk values which led to visual artifacts (different
colored screens instead of usual black during boot).

Fix: Calling read_luts() only when gamma is enabled which will happen
after first modeset.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111809
Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f1328c08f4ad..f89aa4bb9f42 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10528,7 +10528,9 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		i9xx_get_pipe_color_config(pipe_config);
 	}
 
-	intel_color_get_config(pipe_config);
+	if ((INTEL_GEN(dev_priv) >= 11 && (pipe_config->gamma_mode & POST_CSC_GAMMA_ENABLE)) ||
+	   (INTEL_GEN(dev_priv) >= 9 && (pipe_config->gamma_enable)))
+			intel_color_get_config(pipe_config);
 
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	WARN_ON(power_domain_mask & BIT_ULL(power_domain));
-- 
2.23.0



More information about the Intel-gfx mailing list