drm/i915: Move cdclk and pll setup to intel_modeset_compute_config(), v2.
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Mon, 1 Jun 2015 10:50:02 +0000 (12:50 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 12 Jun 2015 10:19:33 +0000 (13:19 +0300)
It makes more sense there, since these are computation steps that can
fail.

Changes since v1:
- Rename __intel_set_mode_checks to intel_modeset_checks (Matt Roper)
- Move intel_modeset_checks to before check_planes, so it won't
  have to be moved later.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_display.c

index b56641b6de7074fa0b447658712f3dbe41675056..12d6da8f0465a527009179489b38fe0a19451c2f 100644 (file)
@@ -12758,38 +12758,7 @@ static void update_scanline_offset(struct intel_crtc *crtc)
                crtc->scanline_offset = 1;
 }
 
-static int
-intel_modeset_compute_config(struct drm_atomic_state *state)
-{
-       struct drm_crtc *crtc;
-       struct drm_crtc_state *crtc_state;
-       int ret, i;
-
-       ret = drm_atomic_helper_check_modeset(state->dev, state);
-       if (ret)
-               return ret;
-
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (!crtc_state->enable &&
-                   WARN_ON(crtc_state->active))
-                       crtc_state->active = false;
-
-               if (!crtc_state->enable)
-                       continue;
-
-               ret = intel_modeset_pipe_config(crtc, state);
-               if (ret)
-                       return ret;
-
-               intel_dump_pipe_config(to_intel_crtc(crtc),
-                                      to_intel_crtc_state(crtc_state),
-                                      "[modeset]");
-       }
-
-       return drm_atomic_helper_check_planes(state->dev, state);
-}
-
-static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
+static int intel_modeset_setup_plls(struct drm_atomic_state *state)
 {
        struct drm_device *dev = state->dev;
        struct drm_i915_private *dev_priv = to_i915(dev);
@@ -12839,7 +12808,7 @@ static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
 }
 
 /* Code that should eventually be part of atomic_check() */
-static int __intel_set_mode_checks(struct drm_atomic_state *state)
+static int intel_modeset_checks(struct drm_atomic_state *state)
 {
        struct drm_device *dev = state->dev;
        int ret;
@@ -12861,11 +12830,42 @@ static int __intel_set_mode_checks(struct drm_atomic_state *state)
                        return ret;
        }
 
-       ret = __intel_set_mode_setup_plls(state);
+       return intel_modeset_setup_plls(state);
+}
+
+static int
+intel_modeset_compute_config(struct drm_atomic_state *state)
+{
+       struct drm_crtc *crtc;
+       struct drm_crtc_state *crtc_state;
+       int ret, i;
+
+       ret = drm_atomic_helper_check_modeset(state->dev, state);
        if (ret)
                return ret;
 
-       return 0;
+       for_each_crtc_in_state(state, crtc, crtc_state, i) {
+               if (!crtc_state->enable &&
+                   WARN_ON(crtc_state->active))
+                       crtc_state->active = false;
+
+               if (!crtc_state->enable)
+                       continue;
+
+               ret = intel_modeset_pipe_config(crtc, state);
+               if (ret)
+                       return ret;
+
+               intel_dump_pipe_config(to_intel_crtc(crtc),
+                                      to_intel_crtc_state(crtc_state),
+                                      "[modeset]");
+       }
+
+       ret = intel_modeset_checks(state);
+       if (ret)
+               return ret;
+
+       return drm_atomic_helper_check_planes(state->dev, state);
 }
 
 static int __intel_set_mode(struct drm_atomic_state *state)
@@ -12877,10 +12877,6 @@ static int __intel_set_mode(struct drm_atomic_state *state)
        int ret = 0;
        int i;
 
-       ret = __intel_set_mode_checks(state);
-       if (ret < 0)
-               return ret;
-
        ret = drm_atomic_helper_prepare_planes(dev, state);
        if (ret)
                return ret;