mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
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:
parent
84105a358f
commit
8f7443ae52
|
|
@ -2837,10 +2837,10 @@ static int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_stat
|
|||
return min_cdclk;
|
||||
}
|
||||
|
||||
int intel_cdclk_update_crtc_min_cdclk(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc,
|
||||
int old_min_cdclk, int new_min_cdclk,
|
||||
bool *need_cdclk_calc)
|
||||
static int intel_cdclk_update_crtc_min_cdclk(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc,
|
||||
int old_min_cdclk, int new_min_cdclk,
|
||||
bool *need_cdclk_calc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_cdclk_state *cdclk_state;
|
||||
|
|
@ -3281,6 +3281,27 @@ static int intel_cdclk_modeset_checks(struct intel_atomic_state *state,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int intel_crtcs_calc_min_cdclk(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc)
|
||||
{
|
||||
const struct intel_crtc_state *old_crtc_state;
|
||||
const struct intel_crtc_state *new_crtc_state;
|
||||
struct intel_crtc *crtc;
|
||||
int i, ret;
|
||||
|
||||
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
|
||||
new_crtc_state, i) {
|
||||
ret = intel_cdclk_update_crtc_min_cdclk(state, crtc,
|
||||
intel_crtc_compute_min_cdclk(old_crtc_state),
|
||||
intel_crtc_compute_min_cdclk(new_crtc_state),
|
||||
need_cdclk_calc);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intel_cdclk_atomic_check(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc)
|
||||
{
|
||||
|
|
@ -3300,11 +3321,12 @@ int intel_cdclk_atomic_check(struct intel_atomic_state *state,
|
|||
* planes are part of the state. We can now compute the minimum cdclk
|
||||
* for each plane.
|
||||
*/
|
||||
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
|
||||
ret = intel_plane_calc_min_cdclk(state, plane, need_cdclk_calc);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
for_each_new_intel_plane_in_state(state, plane, plane_state, i)
|
||||
intel_plane_calc_min_cdclk(state, plane);
|
||||
|
||||
ret = intel_crtcs_calc_min_cdclk(state, need_cdclk_calc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = intel_bw_calc_min_cdclk(state, need_cdclk_calc);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -51,10 +51,6 @@ void intel_cdclk_crtc_disable_noatomic(struct intel_crtc *crtc);
|
|||
int intel_cdclk_update_bw_min_cdclk(struct intel_atomic_state *state,
|
||||
int old_min_cdclk, int new_min_cdclk,
|
||||
bool *need_cdclk_calc);
|
||||
int intel_cdclk_update_crtc_min_cdclk(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc,
|
||||
int old_min_cdclk, int new_min_cdclk,
|
||||
bool *need_cdclk_calc);
|
||||
|
||||
#define to_intel_cdclk_state(global_state) \
|
||||
container_of_const((global_state), struct intel_cdclk_state, base)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -69,9 +69,8 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
|
|||
struct intel_crtc_state *crtc_state,
|
||||
const struct intel_plane_state *old_plane_state,
|
||||
struct intel_plane_state *intel_state);
|
||||
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);
|
||||
int intel_plane_check_clipping(struct intel_plane_state *plane_state,
|
||||
struct intel_crtc_state *crtc_state,
|
||||
int min_scale, int max_scale,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user