drm/i915: Move intel_modeset_all_pipes()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 14 May 2021 15:37:03 +0000 (08:37 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Sat, 15 May 2021 02:47:38 +0000 (19:47 -0700)
Move intel_modeset_all_pipes() to a central place so that we can
use it elsewhere as well. No functional changes.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Clinton Taylor <Clinton.A.Taylor@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210514153711.2359617-12-matthew.d.roper@intel.com
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h

index d401260610388cf3c4bfda87cf43e5b8267c9a9e..c9f1484f3811752783fac086d6988ab372feb655 100644 (file)
@@ -2375,44 +2375,6 @@ static int bxt_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state)
        return 0;
 }
 
-static int intel_modeset_all_pipes(struct intel_atomic_state *state)
-{
-       struct drm_i915_private *dev_priv = to_i915(state->base.dev);
-       struct intel_crtc *crtc;
-
-       /*
-        * Add all pipes to the state, and force
-        * a modeset on all the active ones.
-        */
-       for_each_intel_crtc(&dev_priv->drm, crtc) {
-               struct intel_crtc_state *crtc_state;
-               int ret;
-
-               crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
-               if (IS_ERR(crtc_state))
-                       return PTR_ERR(crtc_state);
-
-               if (!crtc_state->hw.active ||
-                   drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
-                       continue;
-
-               crtc_state->uapi.mode_changed = true;
-
-               ret = drm_atomic_add_affected_connectors(&state->base,
-                                                        &crtc->base);
-               if (ret)
-                       return ret;
-
-               ret = intel_atomic_add_affected_planes(state, crtc);
-               if (ret)
-                       return ret;
-
-               crtc_state->update_planes |= crtc_state->active_planes;
-       }
-
-       return 0;
-}
-
 static int fixed_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state)
 {
        int min_cdclk;
index bf8d1f401defcae1df28faa4db38d128ec4f5027..2abd6bd0969fd11a80b7d7330dfea02d5c87d016 100644 (file)
@@ -9033,6 +9033,44 @@ intel_modeset_verify_disabled(struct drm_i915_private *dev_priv,
        verify_disabled_dpll_state(dev_priv);
 }
 
+int intel_modeset_all_pipes(struct intel_atomic_state *state)
+{
+       struct drm_i915_private *dev_priv = to_i915(state->base.dev);
+       struct intel_crtc *crtc;
+
+       /*
+        * Add all pipes to the state, and force
+        * a modeset on all the active ones.
+        */
+       for_each_intel_crtc(&dev_priv->drm, crtc) {
+               struct intel_crtc_state *crtc_state;
+               int ret;
+
+               crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
+               if (IS_ERR(crtc_state))
+                       return PTR_ERR(crtc_state);
+
+               if (!crtc_state->hw.active ||
+                   drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
+                       continue;
+
+               crtc_state->uapi.mode_changed = true;
+
+               ret = drm_atomic_add_affected_connectors(&state->base,
+                                                        &crtc->base);
+               if (ret)
+                       return ret;
+
+               ret = intel_atomic_add_affected_planes(state, crtc);
+               if (ret)
+                       return ret;
+
+               crtc_state->update_planes |= crtc_state->active_planes;
+       }
+
+       return 0;
+}
+
 static void
 intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state)
 {
index bd69affc791c7c64e4dd5d0b0e17cf0e1d71354e..c9dbaf074d77c91c739abb837013765a9f67036d 100644 (file)
@@ -646,6 +646,7 @@ void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915);
 void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915);
 void intel_display_resume(struct drm_device *dev);
 void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
+int intel_modeset_all_pipes(struct intel_atomic_state *state);
 
 /* modesetting asserts */
 void assert_panel_unlocked(struct drm_i915_private *dev_priv,