]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Introduce intel_calc_enabled_pipes()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 23 Sep 2025 17:19:39 +0000 (20:19 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Sat, 11 Oct 2025 00:48:06 +0000 (03:48 +0300)
Add intel_calc_enabled_pipes() as the counterpart to
intel_calc_active_pipes(). We have some uses where the set
of logically enabled pipes makes more sense than the set of
active pipes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250923171943.7319-18-ville.syrjala@linux.intel.com
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h

index c9bd160c7b32d9f927619bdb79980968eb984a1b..bf05ddebeddae8a8cfe6301181b47c9dc0a3d86e 100644 (file)
@@ -5653,6 +5653,23 @@ static int hsw_mode_set_planes_workaround(struct intel_atomic_state *state)
        return 0;
 }
 
+u8 intel_calc_enabled_pipes(struct intel_atomic_state *state,
+                           u8 enabled_pipes)
+{
+       const struct intel_crtc_state *crtc_state;
+       struct intel_crtc *crtc;
+       int i;
+
+       for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
+               if (crtc_state->hw.enable)
+                       enabled_pipes |= BIT(crtc->pipe);
+               else
+                       enabled_pipes &= ~BIT(crtc->pipe);
+       }
+
+       return enabled_pipes;
+}
+
 u8 intel_calc_active_pipes(struct intel_atomic_state *state,
                           u8 active_pipes)
 {
index 9a9a44b61f7fd2f42e7c8a9a31c270e56d9ede33..fc2ef92ccf6835198cd220f2a748e1dfd0c5ffe7 100644 (file)
@@ -394,6 +394,8 @@ enum phy_fia {
                                       i)
 
 int intel_atomic_check(struct drm_device *dev, struct drm_atomic_state *state);
+u8 intel_calc_enabled_pipes(struct intel_atomic_state *state,
+                           u8 enabled_pipes);
 u8 intel_calc_active_pipes(struct intel_atomic_state *state,
                           u8 active_pipes);
 void intel_link_compute_m_n(u16 bpp, int nlanes,