drm/i915: disable all crtcs at suspend time
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Jul 2012 17:21:47 +0000 (19:21 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Sep 2012 06:21:29 +0000 (08:21 +0200)
We need this to avoid confusing the hw state readout code with the cpt
pch plls at resume time: We'd read the new pipe state (which is
disabled), but still believe that we have a life pll connected to that
pipe (from before the suspend). Hence properly disable pipes to clear
out all the residual state.

This has the neat side-effect that we don't enable ports prematurely
by restoring bogus state from the saved register values.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index 4abac6d6c3e621db002959acb354bb598d74cafa..fe7512ae3945113adcb92a2b85192667a5363936 100644 (file)
@@ -470,6 +470,9 @@ static int i915_drm_freeze(struct drm_device *dev)
                                "GEM idle failed, resume might fail\n");
                        return error;
                }
+
+               intel_modeset_disable(dev);
+
                drm_irq_uninstall(dev);
        }
 
index 2a393cbe617323153d2498a10fe4979044aba2f2..4c0ec180564f5978e75a74de9763d702a214d14b 100644 (file)
@@ -3545,6 +3545,16 @@ static void intel_crtc_disable(struct drm_crtc *crtc)
        }
 }
 
+void intel_modeset_disable(struct drm_device *dev)
+{
+       struct drm_crtc *crtc;
+
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               if (crtc->enabled)
+                       intel_crtc_disable(crtc);
+       }
+}
+
 void intel_encoder_noop(struct drm_encoder *encoder)
 {
 }
index d03e77752157372fadf6c0f7fbff33c52026c994..2061399d92c1c975a628bae4540103b8e397d354 100644 (file)
@@ -446,6 +446,7 @@ struct intel_set_config {
 
 extern bool intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
                           int x, int y, struct drm_framebuffer *old_fb);
+extern void intel_modeset_disable(struct drm_device *dev);
 extern void intel_crtc_load_lut(struct drm_crtc *crtc);
 extern void intel_crtc_update_dpms(struct drm_crtc *crtc);
 extern void intel_encoder_noop(struct drm_encoder *encoder);