Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/icl: Update csc and gamma enable checks
@ 2024-10-03  9:03 Sai Teja Pottumuttu
  2024-10-03  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Sai Teja Pottumuttu @ 2024-10-03  9:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: matthew.d.roper, ville.syrjala, Sai Teja Pottumuttu

With ICL, we have a way to check if gamma and csc are enabled on
a pipe using bits in GAMMA_MODE and CSC_MODE. So, use them as well
along with the existing BOTTOM_COLOR checks.

BSpec: 7463, 7466
Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
---
 drivers/gpu/drm/i915/display/intel_color.c | 24 ++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index 50f41aeb3c28..1bf36898dc7e 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -1076,6 +1076,26 @@ static void skl_get_config(struct intel_crtc_state *crtc_state)
 		crtc_state->csc_enable = true;
 }
 
+static void icl_get_config(struct intel_crtc_state *crtc_state)
+{
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
+	u32 bottom_color;
+
+	crtc_state->gamma_mode = hsw_read_gamma_mode(crtc);
+	crtc_state->csc_mode = ilk_read_csc_mode(crtc);
+
+	bottom_color = intel_de_read(i915, SKL_BOTTOM_COLOR(crtc->pipe));
+
+	if ((bottom_color & SKL_BOTTOM_COLOR_GAMMA_ENABLE) ||
+	    (crtc_state->gamma_mode & POST_CSC_GAMMA_ENABLE))
+		crtc_state->gamma_enable = true;
+
+	if ((bottom_color & SKL_BOTTOM_COLOR_CSC_ENABLE) ||
+	    (crtc_state->csc_mode & ICL_CSC_ENABLE))
+		crtc_state->csc_enable = true;
+}
+
 static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -3811,7 +3831,7 @@ static const struct intel_color_funcs tgl_color_funcs = {
 	.read_luts = icl_read_luts,
 	.lut_equal = icl_lut_equal,
 	.read_csc = icl_read_csc,
-	.get_config = skl_get_config,
+	.get_config = icl_get_config,
 };
 
 static const struct intel_color_funcs icl_color_funcs = {
@@ -3823,7 +3843,7 @@ static const struct intel_color_funcs icl_color_funcs = {
 	.read_luts = icl_read_luts,
 	.lut_equal = icl_lut_equal,
 	.read_csc = icl_read_csc,
-	.get_config = skl_get_config,
+	.get_config = icl_get_config,
 };
 
 static const struct intel_color_funcs glk_color_funcs = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-10-07 19:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  9:03 [PATCH] drm/i915/icl: Update csc and gamma enable checks Sai Teja Pottumuttu
2024-10-03  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-10-03 10:46 ` [PATCH] " Jani Nikula
2024-10-03 11:10 ` Ville Syrjälä
2024-10-03 14:22   ` Matt Roper
2024-10-03 14:32     ` Ville Syrjälä
2024-10-03 14:58       ` Ville Syrjälä
2024-10-03 15:38         ` Pottumuttu, Sai Teja
2024-10-03 15:46           ` Ville Syrjälä
2024-10-03 15:56             ` Pottumuttu, Sai Teja
2024-10-03 16:02               ` Jani Nikula
2024-10-03 16:05             ` Matt Roper
2024-10-03 16:12               ` Ville Syrjälä
2024-10-03 16:20                 ` Matt Roper
2024-10-03 16:43                   ` Ville Syrjälä
2024-10-07 19:33 ` ✗ Fi.CI.IGT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox