drm/i915: Introduce intel_crtc_joined_pipe_mask()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 4 Apr 2024 21:34:35 +0000 (00:34 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 9 Apr 2024 15:26:47 +0000 (18:26 +0300)
Add a small helper to compute the set of pipes that the current
crtc is using.

And we have at least one trivial place in
intel_ddi_update_active_dpll() where we can use it
immediately, so let's do that.

v2: Use the name 'pipe_crtc' for the per-pipe crtc pointer

Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240404213441.17637-12-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h

index 793ef3e387c6cb677bc098e181a5af3c4e30e85f..312e90da78bfb501bc2cb1e1b1b4305067f72bd0 100644 (file)
@@ -3462,18 +3462,17 @@ void intel_ddi_update_active_dpll(struct intel_atomic_state *state,
                                  struct intel_crtc *crtc)
 {
        struct drm_i915_private *i915 = to_i915(encoder->base.dev);
-       struct intel_crtc_state *crtc_state =
+       const struct intel_crtc_state *crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
-       struct intel_crtc *slave_crtc;
+       struct intel_crtc *pipe_crtc;
 
        /* FIXME: Add MTL pll_mgr */
        if (DISPLAY_VER(i915) >= 14 || !intel_encoder_is_tc(encoder))
                return;
 
-       intel_update_active_dpll(state, crtc, encoder);
-       for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
-                                        intel_crtc_bigjoiner_slave_pipes(crtc_state))
-               intel_update_active_dpll(state, slave_crtc, encoder);
+       for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
+                                        intel_crtc_joined_pipe_mask(crtc_state))
+               intel_update_active_dpll(state, pipe_crtc, encoder);
 }
 
 static void
index 74018de5a17f521ace5351795e5ddbec50f0c239..912213ee025007ab5181eb124baca6739957af37 100644 (file)
@@ -275,6 +275,13 @@ static int intel_bigjoiner_num_pipes(const struct intel_crtc_state *crtc_state)
        return hweight8(crtc_state->bigjoiner_pipes);
 }
 
+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)
+{
+       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+       return BIT(crtc->pipe) | crtc_state->bigjoiner_pipes;
+}
+
 struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state)
 {
        struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
index 423074d6947a4f180ec1185e504803247ea662b9..898b116633772a27b8540a5c0dc0b45875325d26 100644 (file)
@@ -416,6 +416,7 @@ intel_cpu_transcoder_mode_valid(struct drm_i915_private *i915,
 enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port);
 bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
 bool is_trans_port_sync_master(const struct intel_crtc_state *state);
+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state);
 bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
 bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
 u8 intel_crtc_bigjoiner_slave_pipes(const struct intel_crtc_state *crtc_state);