drm/i915: Fix RC6 suspend/resume
authorAndrew Lutomirski <luto@mit.edu>
Mon, 21 Dec 2009 15:10:22 +0000 (10:10 -0500)
committerEric Anholt <eric@anholt.net>
Wed, 6 Jan 2010 17:39:53 +0000 (09:39 -0800)
We restored RC6 twice on resume, even with modesetting off.  Instead,
only restore it once and skip RC6 initialization entirely in non-KMS mode.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_suspend.c
drivers/gpu/drm/i915/intel_display.c

index 7eb4ad51034d57fd051e2c705cf3577f4bf9fbcc..29dd676269675edb34efeace6ee605dc600a8e7e 100644 (file)
@@ -307,8 +307,6 @@ typedef struct drm_i915_private {
        u32 saveDSPACNTR;
        u32 saveDSPBCNTR;
        u32 saveDSPARB;
-       u32 saveRENDERSTANDBY;
-       u32 savePWRCTXA;
        u32 saveHWS;
        u32 savePIPEACONF;
        u32 savePIPEBCONF;
index d5ebb00a9d49de32e379afb8602d46d279799e65..a3b90c9561dc6623b6671ad4aaefbfd957e65ed8 100644 (file)
@@ -732,12 +732,6 @@ int i915_save_state(struct drm_device *dev)
 
        pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
 
-       /* Render Standby */
-       if (I915_HAS_RC6(dev)) {
-               dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
-               dev_priv->savePWRCTXA = I915_READ(PWRCTXA);
-       }
-
        /* Hardware status page */
        dev_priv->saveHWS = I915_READ(HWS_PGA);
 
@@ -793,12 +787,6 @@ int i915_restore_state(struct drm_device *dev)
 
        pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
 
-       /* Render Standby */
-       if (I915_HAS_RC6(dev)) {
-               I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY);
-               I915_WRITE(PWRCTXA, dev_priv->savePWRCTXA);
-       }
-
        /* Hardware status page */
        I915_WRITE(HWS_PGA, dev_priv->saveHWS);
 
index c21dede6461c3819804a6fb3faf7a90083e441fa..089b1df5448be81586764260517b1b78b59e41c0 100644 (file)
@@ -4593,7 +4593,7 @@ void intel_init_clock_gating(struct drm_device *dev)
         * GPU can automatically power down the render unit if given a page
         * to save state.
         */
-       if (I915_HAS_RC6(dev)) {
+       if (I915_HAS_RC6(dev) && drm_core_check_feature(dev, DRIVER_MODESET)) {
                struct drm_gem_object *pwrctx;
                struct drm_i915_gem_object *obj_priv;
                int ret;