Commit e17643d0 authored by Jani Nikula's avatar Jani Nikula
Browse files

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: default avatarImre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/163fda39da2e1cf0f0c4fcb9c71103c98863179e.1750847509.git.jani.nikula@intel.com


Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent d1b8a4dc
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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;
}
+2 −0
Original line number Diff line number Diff line
@@ -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__ */
+1 −5
Original line number Diff line number Diff line
@@ -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))