Commit b8459c3b authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Introduce intel_crtc_enable_changed() and intel_any_crtc_enable_changed()



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

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250923171943.7319-2-ville.syrjala@linux.intel.com


Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent 324ccdb5
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -753,3 +753,24 @@ void intel_pipe_update_end(struct intel_atomic_state *state,
out:
	intel_psr_unlock(new_crtc_state);
}

bool intel_crtc_enable_changed(const struct intel_crtc_state *old_crtc_state,
			       const struct intel_crtc_state *new_crtc_state)
{
	return old_crtc_state->hw.enable != new_crtc_state->hw.enable;
}

bool intel_any_crtc_enable_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_enable_changed(old_crtc_state, new_crtc_state))
			return true;
	}

	return false;
}
+4 −0
Original line number Diff line number Diff line
@@ -58,4 +58,8 @@ void intel_wait_for_vblank_if_active(struct intel_display *display,
				     enum pipe pipe);
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);

#endif