mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
drm/i915/bw: abstract intel_bw_pmdemand_needs_update()
Add intel_bw_pmdemand_needs_update() helper to avoid looking at struct intel_bw_state internals outside of intel_bw.c. Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://lore.kernel.org/r/163fda39da2e1cf0f0c4fcb9c71103c98863179e.1750847509.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
d1b8a4dc09
commit
e17643d075
|
|
@ -1651,3 +1651,17 @@ int intel_bw_init(struct intel_display *display)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool intel_bw_pmdemand_needs_update(struct intel_atomic_state *state)
|
||||
{
|
||||
const struct intel_bw_state *new_bw_state, *old_bw_state;
|
||||
|
||||
new_bw_state = intel_atomic_get_new_bw_state(state);
|
||||
old_bw_state = intel_atomic_get_old_bw_state(state);
|
||||
|
||||
if (new_bw_state &&
|
||||
new_bw_state->qgv_point_peakbw != old_bw_state->qgv_point_peakbw)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,4 +76,6 @@ int intel_bw_min_cdclk(struct intel_display *display,
|
|||
void intel_bw_update_hw_state(struct intel_display *display);
|
||||
void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc);
|
||||
|
||||
bool intel_bw_pmdemand_needs_update(struct intel_atomic_state *state);
|
||||
|
||||
#endif /* __INTEL_BW_H__ */
|
||||
|
|
|
|||
|
|
@ -294,16 +294,12 @@ intel_pmdemand_connector_needs_update(struct intel_atomic_state *state)
|
|||
|
||||
static bool intel_pmdemand_needs_update(struct intel_atomic_state *state)
|
||||
{
|
||||
const struct intel_bw_state *new_bw_state, *old_bw_state;
|
||||
const struct intel_cdclk_state *new_cdclk_state, *old_cdclk_state;
|
||||
const struct intel_crtc_state *new_crtc_state, *old_crtc_state;
|
||||
struct intel_crtc *crtc;
|
||||
int i;
|
||||
|
||||
new_bw_state = intel_atomic_get_new_bw_state(state);
|
||||
old_bw_state = intel_atomic_get_old_bw_state(state);
|
||||
if (new_bw_state && new_bw_state->qgv_point_peakbw !=
|
||||
old_bw_state->qgv_point_peakbw)
|
||||
if (intel_bw_pmdemand_needs_update(state))
|
||||
return true;
|
||||
|
||||
if (intel_dbuf_pmdemand_needs_update(state))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user