]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Introduce intel_crtc_active_changed() and intel_any_crtc_active_changed()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 23 Sep 2025 17:19:24 +0000 (20:19 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Oct 2025 23:48:26 +0000 (02:48 +0300)
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>
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_crtc.h

index ea735f76107b8efaedff342e561f3fb51bcc38a1..7b39c3a5887cbda2e963578f16a50933bc4e3abb 100644 (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;
+}
index eae88e604e0822fbd9afab6ad7a11eb425b21647..cee09e7cd3dc20f3489eca8ffcf6cddd780cf254 100644 (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