drm/i915/cdclk: Do intel_cdclk_update_crtc_min_cdclk() per-pipe

Currently we call intel_cdclk_update_crtc_min_cdclk() per-plane.
That is rather wasteful, and also won't account for any of the
other per-pipe min_cdclk restrictions from
intel_crtc_compute_min_cdclk(). Change the behaviour to do
do the comparison per-crtc instead, and use the final min cdclk
as computed by intel_crtc_compute_min_cdclk().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250923171943.7319-13-ville.syrjala@linux.intel.com
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
This commit is contained in:
Ville Syrjälä
2025-09-23 20:19:34 +03:00
parent 84105a358f
commit 8f7443ae52
4 changed files with 36 additions and 32 deletions

View File

@@ -291,34 +291,21 @@ intel_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,
rel_data_rate);
}
int intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
struct intel_plane *plane,
bool *need_cdclk_calc)
void intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
struct intel_plane *plane)
{
const struct intel_plane_state *plane_state =
intel_atomic_get_new_plane_state(state, plane);
struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc);
const struct intel_crtc_state *old_crtc_state;
struct intel_crtc_state *new_crtc_state;
int ret;
if (!plane_state->uapi.visible || !plane->min_cdclk)
return 0;
return;
old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc);
new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
new_crtc_state->min_cdclk[plane->id] =
plane->min_cdclk(new_crtc_state, plane_state);
ret = intel_cdclk_update_crtc_min_cdclk(state, crtc,
old_crtc_state->min_cdclk[plane->id],
new_crtc_state->min_cdclk[plane->id],
need_cdclk_calc);
if (ret)
return ret;
return 0;
}
static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state)