summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2025-11-17 13:45:39 +0300
committerMika Kahola <mika.kahola@intel.com>2025-11-19 14:24:20 +0300
commit5df82b17928b8f14d7167a5e199b4cb58bfe39e1 (patch)
treeecee8f40ba5155e8e8865d9a11de30466cfe1847
parent230d4c748113d83931a5b57c844fb71faf9eebe3 (diff)
downloadlinux-5df82b17928b8f14d7167a5e199b4cb58bfe39e1.tar.xz
drm/i915/cx0: Sanitize C10 PHY PLL SSC register setup
Define the C10 PLL SSC register range via macros, so the HW/SW state of these register can be verified by a follow-up change, reusing these macros. Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://lore.kernel.org/r/20251117104602.2363671-10-mika.kahola@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_cx0_phy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
index 2ab93d02fdf1..f190762e4871 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -2059,6 +2059,9 @@ static void intel_cx0pll_update_ssc(struct intel_encoder *encoder,
}
}
+#define C10_PLL_SSC_REG_START_IDX 4
+#define C10_PLL_SSC_REG_COUNT 5
+
static void intel_c10pll_update_pll(struct intel_encoder *encoder,
struct intel_cx0pll_state *pll_state)
{
@@ -2068,8 +2071,11 @@ static void intel_c10pll_update_pll(struct intel_encoder *encoder,
if (pll_state->ssc_enabled)
return;
- drm_WARN_ON(display->drm, ARRAY_SIZE(pll_state->c10.pll) < 9);
- for (i = 4; i < 9; i++)
+ drm_WARN_ON(display->drm, ARRAY_SIZE(pll_state->c10.pll) <
+ C10_PLL_SSC_REG_START_IDX + C10_PLL_SSC_REG_COUNT);
+ for (i = C10_PLL_SSC_REG_START_IDX;
+ i < C10_PLL_SSC_REG_START_IDX + C10_PLL_SSC_REG_COUNT;
+ i++)
pll_state->c10.pll[i] = 0;
}