]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: Enable/disable shared dplls just the once for joined pipes
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 10 Mar 2025 18:35:27 +0000 (20:35 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 25 Mar 2025 20:44:26 +0000 (22:44 +0200)
Currently we loop over all joined pipes and enable/disable the
shared dplls for each. We don't really have to do that since
all joined pipes will be using the same dpll. So let's just do
the enable/disable once for the whole set of joined pipes.
We can still keep tracking the dpll active set as pipes as long
as we remember to flip the bits for all the joined pipes on one go.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250310183528.3203-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_dpll_mgr.c

index a2e6c01beeb5c7ff8f12888d862e9ca606746e02..526074ed50264c6129a56ecfd3b450e78f1ba1b1 100644 (file)
@@ -1661,13 +1661,8 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
 
        intel_encoders_pre_pll_enable(state, crtc);
 
-       for_each_pipe_crtc_modeset_enable(display, pipe_crtc, new_crtc_state, i) {
-               const struct intel_crtc_state *pipe_crtc_state =
-                       intel_atomic_get_new_crtc_state(state, pipe_crtc);
-
-               if (pipe_crtc_state->shared_dpll)
-                       intel_enable_shared_dpll(pipe_crtc_state);
-       }
+       if (new_crtc_state->shared_dpll)
+               intel_enable_shared_dpll(new_crtc_state);
 
        intel_encoders_pre_enable(state, crtc);
 
@@ -1798,12 +1793,7 @@ static void hsw_crtc_disable(struct intel_atomic_state *state,
        intel_encoders_disable(state, crtc);
        intel_encoders_post_disable(state, crtc);
 
-       for_each_pipe_crtc_modeset_disable(display, pipe_crtc, old_crtc_state, i) {
-               const struct intel_crtc_state *old_pipe_crtc_state =
-                       intel_atomic_get_old_crtc_state(state, pipe_crtc);
-
-               intel_disable_shared_dpll(old_pipe_crtc_state);
-       }
+       intel_disable_shared_dpll(old_crtc_state);
 
        intel_encoders_post_pll_disable(state, crtc);
 
index 953cac2bd1dc4313978f6fa3ed2546e07a35149b..ec7feef1ef59bb6a926840f8e17f4411b5cdc573 100644 (file)
@@ -257,7 +257,7 @@ void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state)
        struct intel_display *display = to_intel_display(crtc_state);
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        struct intel_shared_dpll *pll = crtc_state->shared_dpll;
-       unsigned int pipe_mask = BIT(crtc->pipe);
+       unsigned int pipe_mask = intel_crtc_joined_pipe_mask(crtc_state);
        unsigned int old_mask;
 
        if (drm_WARN_ON(display->drm, !pll))
@@ -303,7 +303,7 @@ void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state)
        struct intel_display *display = to_intel_display(crtc_state);
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        struct intel_shared_dpll *pll = crtc_state->shared_dpll;
-       unsigned int pipe_mask = BIT(crtc->pipe);
+       unsigned int pipe_mask = intel_crtc_joined_pipe_mask(crtc_state);
 
        /* PCH only available on ILK+ */
        if (DISPLAY_VER(display) < 5)