Skip to content

Commit a4a9779

Browse files
mkaholajlahtine-intel
authored andcommitted
drm/i915/display: Fix C20 pll selection for state verification
Add pll selection check for C20 as well as clock state verification0. We have been relying on sw state to select A or B pll's. This is incorrect as the hw might see this selection differently. This patch fixes this shortcoming by reading pll selection for both sw and hw states and compares if these two selections match. Fixes: 59be902 ("drm/i915/mtl: C20 state verification") v2: reword commit message and include fix to a original commit (Imre) Compare pll selection (Jani) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240102115741.118525-2-mika.kahola@intel.com (cherry picked from commit f4304be) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent b76c01f commit a4a9779

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,24 +3067,29 @@ static void intel_c20pll_state_verify(const struct intel_crtc_state *state,
30673067
{
30683068
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
30693069
const struct intel_c20pll_state *mpll_sw_state = &state->cx0pll_state.c20;
3070-
bool use_mplla;
3070+
bool sw_use_mpllb = mpll_sw_state->tx[0] & C20_PHY_USE_MPLLB;
3071+
bool hw_use_mpllb = mpll_hw_state->tx[0] & C20_PHY_USE_MPLLB;
30713072
int i;
30723073

3073-
use_mplla = intel_c20_use_mplla(mpll_hw_state->clock);
3074-
if (use_mplla) {
3075-
for (i = 0; i < ARRAY_SIZE(mpll_sw_state->mplla); i++) {
3076-
I915_STATE_WARN(i915, mpll_hw_state->mplla[i] != mpll_sw_state->mplla[i],
3077-
"[CRTC:%d:%s] mismatch in C20MPLLA: Register[%d] (expected 0x%04x, found 0x%04x)",
3078-
crtc->base.base.id, crtc->base.name, i,
3079-
mpll_sw_state->mplla[i], mpll_hw_state->mplla[i]);
3080-
}
3081-
} else {
3074+
I915_STATE_WARN(i915, sw_use_mpllb != hw_use_mpllb,
3075+
"[CRTC:%d:%s] mismatch in C20: Register MPLLB selection (expected %d, found %d)",
3076+
crtc->base.base.id, crtc->base.name,
3077+
sw_use_mpllb, hw_use_mpllb);
3078+
3079+
if (hw_use_mpllb) {
30823080
for (i = 0; i < ARRAY_SIZE(mpll_sw_state->mpllb); i++) {
30833081
I915_STATE_WARN(i915, mpll_hw_state->mpllb[i] != mpll_sw_state->mpllb[i],
30843082
"[CRTC:%d:%s] mismatch in C20MPLLB: Register[%d] (expected 0x%04x, found 0x%04x)",
30853083
crtc->base.base.id, crtc->base.name, i,
30863084
mpll_sw_state->mpllb[i], mpll_hw_state->mpllb[i]);
30873085
}
3086+
} else {
3087+
for (i = 0; i < ARRAY_SIZE(mpll_sw_state->mplla); i++) {
3088+
I915_STATE_WARN(i915, mpll_hw_state->mplla[i] != mpll_sw_state->mplla[i],
3089+
"[CRTC:%d:%s] mismatch in C20MPLLA: Register[%d] (expected 0x%04x, found 0x%04x)",
3090+
crtc->base.base.id, crtc->base.name, i,
3091+
mpll_sw_state->mplla[i], mpll_hw_state->mplla[i]);
3092+
}
30883093
}
30893094

30903095
for (i = 0; i < ARRAY_SIZE(mpll_sw_state->tx); i++) {

0 commit comments

Comments
 (0)