Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: C20 clock state verification
@ 2023-12-15  8:00 Mika Kahola
  2023-12-15  8:53 ` Imre Deak
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mika Kahola @ 2023-12-15  8:00 UTC (permalink / raw)
  To: intel-gfx

Add clock state verification for C20. Since we
are usign either A or B contexts, which are
selected based on clock rate, we first need to
calculate hw clock and use that clock to select
which context we are using.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/display/intel_cx0_phy.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
index 775c1c4a8978..6757e9f941e4 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -3079,8 +3079,9 @@ static void intel_c20pll_state_verify(const struct intel_crtc_state *state,
 	const struct intel_c20pll_state *mpll_sw_state = &state->cx0pll_state.c20;
 	bool use_mplla;
 	int i;
+	int hw_clock = intel_c20pll_calc_port_clock(encoder, mpll_hw_state);
 
-	use_mplla = intel_c20_use_mplla(mpll_hw_state->clock);
+	use_mplla = intel_c20_use_mplla(hw_clock);
 	if (use_mplla) {
 		for (i = 0; i < ARRAY_SIZE(mpll_sw_state->mplla); i++) {
 			I915_STATE_WARN(i915, mpll_hw_state->mplla[i] != mpll_sw_state->mplla[i],
@@ -3110,6 +3111,11 @@ static void intel_c20pll_state_verify(const struct intel_crtc_state *state,
 				crtc->base.base.id, crtc->base.name, i,
 				mpll_sw_state->cmn[i], mpll_hw_state->cmn[i]);
 	}
+
+	I915_STATE_WARN(i915, hw_clock != mpll_sw_state->clock,
+			"[CRTC:%d:%s] mismatch in C20: Register CLOCK (expected %d, found %d)",
+			crtc->base.base.id, crtc->base.name,
+			mpll_sw_state->clock, hw_clock);
 }
 
 void intel_cx0pll_state_verify(struct intel_atomic_state *state,
-- 
2.34.1


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

end of thread, other threads:[~2023-12-20  8:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15  8:00 [PATCH] drm/i915/display: C20 clock state verification Mika Kahola
2023-12-15  8:53 ` Imre Deak
2023-12-15  9:01   ` Imre Deak
2023-12-15 14:00     ` Kahola, Mika
2023-12-15 15:10       ` Jani Nikula
2023-12-20  8:05         ` Kahola, Mika
2023-12-15  9:10   ` Ville Syrjälä
2023-12-15  9:17     ` Imre Deak
2023-12-15 12:49 ` ✓ Fi.CI.BAT: success for " Patchwork
2023-12-15 23:27 ` ✓ Fi.CI.IGT: " Patchwork

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