drm/i915: Introduce intel_crtc_active_changed() and intel_any_crtc_active_changed()

Introduce helpers that determine whether any crtc is changing
its active state. Will be useful for cdclk stuff.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250923171943.7319-3-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:24 +03:00
parent b8459c3b6e
commit 663cb3e9b4
2 changed files with 24 additions and 0 deletions

View File

@@ -774,3 +774,24 @@ bool intel_any_crtc_enable_changed(struct intel_atomic_state *state)
return false;
}
bool intel_crtc_active_changed(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state)
{
return old_crtc_state->hw.active != new_crtc_state->hw.active;
}
bool intel_any_crtc_active_changed(struct intel_atomic_state *state)
{
const struct intel_crtc_state *old_crtc_state, *new_crtc_state;
struct intel_crtc *crtc;
int i;
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
new_crtc_state, i) {
if (intel_crtc_active_changed(old_crtc_state, new_crtc_state))
return true;
}
return false;
}

View File

@@ -61,5 +61,8 @@ void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
bool intel_any_crtc_enable_changed(struct intel_atomic_state *state);
bool intel_crtc_enable_changed(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state);
bool intel_any_crtc_active_changed(struct intel_atomic_state *state);
bool intel_crtc_active_changed(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state);
#endif