Skip to content

Commit 233624e

Browse files
committed
drm/i915: Apply CMTG clock disabling WA while DPLL0 is enabled
CI test results/further experiments show that the workaround added in commit 573d7ce ("drm/i915/adlp: Add workaround to disable CMTG clock gating") can be applied only while DPLL0 is enabled. If it's disabled the TRANS_CMTG_CHICKEN register is not accessible. Accordingly move the WA to DPLL0 HW state sanitization and enabling. This fixes an issue where the WA won't get applied (and a WARN is thrown due to an unexpected value in TRANS_CMTG_CHICKEN) if the driver is loaded without DPLL0 being enabled: booting without BIOS enabling an output with this PLL, or reloading the driver. While at it also add a debug print for the unexpected register value. Cc: José Roberto de Souza <[email protected]> Signed-off-by: Imre Deak <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 82929a2 commit 233624e

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13281,24 +13281,6 @@ static void intel_early_display_was(struct drm_i915_private *dev_priv)
1328113281
KBL_ARB_FILL_SPARE_13 | KBL_ARB_FILL_SPARE_14,
1328213282
KBL_ARB_FILL_SPARE_14);
1328313283
}
13284-
13285-
if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
13286-
u32 val;
13287-
13288-
/*
13289-
* Wa_16011069516:adl-p[a0]
13290-
*
13291-
* All CMTG regs are unreliable until CMTG clock gating is
13292-
* disabled, so we can only assume the default CMTG_CHICKEN
13293-
* reg value and sanity check this assumption with a double
13294-
* read, which presumably returns the correct value even with
13295-
* clock gating on.
13296-
*/
13297-
val = intel_de_read(dev_priv, TRANS_CMTG_CHICKEN);
13298-
val = intel_de_read(dev_priv, TRANS_CMTG_CHICKEN);
13299-
intel_de_write(dev_priv, TRANS_CMTG_CHICKEN, DISABLE_DPT_CLK_GATING);
13300-
drm_WARN_ON(&dev_priv->drm, val & ~DISABLE_DPT_CLK_GATING);
13301-
}
1330213284
}
1330313285

1330413286
static void ibx_sanitize_pch_hdmi_port(struct drm_i915_private *dev_priv,

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3735,6 +3735,31 @@ static void icl_pll_enable(struct drm_i915_private *dev_priv,
37353735
drm_err(&dev_priv->drm, "PLL %d not locked\n", pll->info->id);
37363736
}
37373737

3738+
static void adlp_cmtg_clock_gating_wa(struct drm_i915_private *i915, struct intel_shared_dpll *pll)
3739+
{
3740+
u32 val;
3741+
3742+
if (!IS_ADLP_DISPLAY_STEP(i915, STEP_A0, STEP_B0) ||
3743+
pll->info->id != DPLL_ID_ICL_DPLL0)
3744+
return;
3745+
/*
3746+
* Wa_16011069516:adl-p[a0]
3747+
*
3748+
* All CMTG regs are unreliable until CMTG clock gating is disabled,
3749+
* so we can only assume the default TRANS_CMTG_CHICKEN reg value and
3750+
* sanity check this assumption with a double read, which presumably
3751+
* returns the correct value even with clock gating on.
3752+
*
3753+
* Instead of the usual place for workarounds we apply this one here,
3754+
* since TRANS_CMTG_CHICKEN is only accessible while DPLL0 is enabled.
3755+
*/
3756+
val = intel_de_read(i915, TRANS_CMTG_CHICKEN);
3757+
val = intel_de_read(i915, TRANS_CMTG_CHICKEN);
3758+
intel_de_write(i915, TRANS_CMTG_CHICKEN, DISABLE_DPT_CLK_GATING);
3759+
if (drm_WARN_ON(&i915->drm, val & ~DISABLE_DPT_CLK_GATING))
3760+
drm_dbg_kms(&i915->drm, "Unexpected flags in TRANS_CMTG_CHICKEN: %08x\n", val);
3761+
}
3762+
37383763
static void combo_pll_enable(struct drm_i915_private *dev_priv,
37393764
struct intel_shared_dpll *pll)
37403765
{
@@ -3764,6 +3789,8 @@ static void combo_pll_enable(struct drm_i915_private *dev_priv,
37643789

37653790
icl_pll_enable(dev_priv, pll, enable_reg);
37663791

3792+
adlp_cmtg_clock_gating_wa(dev_priv, pll);
3793+
37673794
/* DVFS post sequence would be here. See the comment above. */
37683795
}
37693796

@@ -4273,7 +4300,12 @@ void intel_dpll_readout_hw_state(struct drm_i915_private *i915)
42734300
static void sanitize_dpll_state(struct drm_i915_private *i915,
42744301
struct intel_shared_dpll *pll)
42754302
{
4276-
if (!pll->on || pll->active_mask)
4303+
if (!pll->on)
4304+
return;
4305+
4306+
adlp_cmtg_clock_gating_wa(i915, pll);
4307+
4308+
if (pll->active_mask)
42774309
return;
42784310

42794311
drm_dbg_kms(&i915->drm,

0 commit comments

Comments
 (0)