Revert "drm/i915: Make intel_display_suspend atomic, v2."
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 10 Jun 2015 08:24:19 +0000 (10:24 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 12 Jun 2015 10:19:35 +0000 (13:19 +0300)
This reverts commit 490f400db5d886fc28566af69b02f6497f31be4b.

We're not ready yet to make it atomic, we calculate some state in
advance, but without atomic plane support atomic the hw readout will
fail.

It's required to revert this commit to revert the atomic hw
state readout patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90868
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90861
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index d3632c56fdf74dde1303c2f07b6fe78958f528f8..78ef0bb53c36a51b25a23df2082e3f1693ce543a 100644 (file)
@@ -634,9 +634,6 @@ static int i915_drm_suspend(struct drm_device *dev)
        intel_display_suspend(dev);
        drm_modeset_unlock_all(dev);
 
-       /* suspending displays will unsets init power */
-       intel_display_set_init_power(dev_priv, true);
-
        intel_dp_mst_suspend(dev);
 
        intel_runtime_pm_disable_interrupts(dev_priv);
index a232dc9f51f627834aac43a21316517922c7ecb5..cc7fad9905b9a9a15fb485816f7f3cf6d84b37b1 100644 (file)
@@ -6191,58 +6191,27 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
  * turn all crtc's off, but do not adjust state
  * This has to be paired with a call to intel_modeset_setup_hw_state.
  */
-int intel_display_suspend(struct drm_device *dev)
+void intel_display_suspend(struct drm_device *dev)
 {
-       struct drm_mode_config *config = &dev->mode_config;
-       struct drm_modeset_acquire_ctx *ctx = config->acquire_ctx;
-       struct drm_atomic_state *state;
+       struct drm_i915_private *dev_priv = to_i915(dev);
        struct drm_crtc *crtc;
-       unsigned crtc_mask = 0;
-       int ret = 0;
-
-       if (WARN_ON(!ctx))
-               return 0;
-
-       lockdep_assert_held(&ctx->ww_ctx);
-       state = drm_atomic_state_alloc(dev);
-       if (WARN_ON(!state))
-               return -ENOMEM;
-
-       state->acquire_ctx = ctx;
-       state->allow_modeset = true;
 
        for_each_crtc(dev, crtc) {
-               struct drm_crtc_state *crtc_state =
-                       drm_atomic_get_crtc_state(state, crtc);
-
-               ret = PTR_ERR_OR_ZERO(crtc_state);
-               if (ret)
-                       goto free;
+               struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+               enum intel_display_power_domain domain;
+               unsigned long domains;
 
-               if (!crtc_state->active)
+               if (!intel_crtc->active)
                        continue;
 
-               crtc_state->active = false;
-               crtc_mask |= 1 << drm_crtc_index(crtc);
-       }
-
-       if (crtc_mask) {
-               ret = intel_set_mode(state);
-
-               if (!ret) {
-                       for_each_crtc(dev, crtc)
-                               if (crtc_mask & (1 << drm_crtc_index(crtc)))
-                                       crtc->state->active = true;
+               intel_crtc_disable_planes(crtc);
+               dev_priv->display.crtc_disable(crtc);
 
-                       return ret;
-               }
+               domains = intel_crtc->enabled_power_domains;
+               for_each_power_domain(domain, domains)
+                       intel_display_power_put(dev_priv, domain);
+               intel_crtc->enabled_power_domains = 0;
        }
-
-free:
-       if (ret)
-               DRM_ERROR("Suspending crtc's failed with %i\n", ret);
-       drm_atomic_state_free(state);
-       return ret;
 }
 
 /* Master function to enable/disable CRTC and corresponding power wells */
index 5312160e7c9511138ae2640980716ef7ce852c95..9ca683ae2dec99f531f6d69c54c944955f077158 100644 (file)
@@ -992,7 +992,7 @@ int intel_pch_rawclk(struct drm_device *dev);
 void intel_mark_busy(struct drm_device *dev);
 void intel_mark_idle(struct drm_device *dev);
 void intel_crtc_restore_mode(struct drm_crtc *crtc);
-int intel_display_suspend(struct drm_device *dev);
+void intel_display_suspend(struct drm_device *dev);
 int intel_crtc_control(struct drm_crtc *crtc, bool enable);
 void intel_crtc_update_dpms(struct drm_crtc *crtc);
 void intel_encoder_destroy(struct drm_encoder *encoder);