Refactor the DG2 MPLLB enable path by splitting out a helper that programs the PHY directly from an intel_mpllb_state.
This is preparatory work for moving DG2 MPLLB handling under the DPLL framework, where callbacks operate on dpll_hw_state rather than the full crtc_state. Assisted-by: Copilot:claude-sonnet-4-6 Signed-off-by: Mika Kahola <[email protected]> --- drivers/gpu/drm/i915/display/intel_snps_phy.c | 11 ++++++++--- drivers/gpu/drm/i915/display/intel_snps_phy.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_snps_phy.c b/drivers/gpu/drm/i915/display/intel_snps_phy.c index bf9df566630f..dfb3a5c35c85 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_phy.c +++ b/drivers/gpu/drm/i915/display/intel_snps_phy.c @@ -1816,11 +1816,10 @@ int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, return -EINVAL; } -void intel_mpllb_enable(struct intel_encoder *encoder, - const struct intel_crtc_state *crtc_state) +void intel_mpllb_enable_phy(struct intel_encoder *encoder, + const struct intel_mpllb_state *pll_state) { struct intel_display *display = to_intel_display(encoder); - const struct intel_mpllb_state *pll_state = &crtc_state->dpll_hw_state.mpllb; enum phy phy = intel_encoder_to_phy(encoder); intel_reg_t enable_reg = (phy <= PHY_D ? DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0)); @@ -1875,6 +1874,12 @@ void intel_mpllb_enable(struct intel_encoder *encoder, */ } +void intel_mpllb_enable(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state) +{ + intel_mpllb_enable_phy(encoder, &crtc_state->dpll_hw_state.mpllb); +} + void intel_mpllb_disable(struct intel_encoder *encoder) { struct intel_display *display = to_intel_display(encoder); diff --git a/drivers/gpu/drm/i915/display/intel_snps_phy.h b/drivers/gpu/drm/i915/display/intel_snps_phy.h index 7f96da22d028..2c7a5f2040f1 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_phy.h +++ b/drivers/gpu/drm/i915/display/intel_snps_phy.h @@ -22,6 +22,8 @@ void intel_snps_phy_update_psr_power_state(struct intel_encoder *encoder, int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder); +void intel_mpllb_enable_phy(struct intel_encoder *encoder, + const struct intel_mpllb_state *pll_state); void intel_mpllb_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state); void intel_mpllb_disable(struct intel_encoder *encoder); -- 2.43.0
