drm/i915/suspend: Flush register writes before busy-waiting.
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 14 Aug 2010 13:41:22 +0000 (14:41 +0100)
committerEric Anholt <eric@anholt.net>
Sun, 22 Aug 2010 06:20:17 +0000 (23:20 -0700)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_suspend.c

index 6e2025274db500e9d11c5ace422000196e457dd6..05acc26fabf7a30d3f89f0a7e188949dc2687355 100644 (file)
@@ -395,16 +395,20 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
        if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) {
                I915_WRITE(dpll_a_reg, dev_priv->saveDPLL_A &
                           ~DPLL_VCO_ENABLE);
-               DRM_UDELAY(150);
+               POSTING_READ(dpll_a_reg);
+               udelay(150);
        }
        I915_WRITE(fpa0_reg, dev_priv->saveFPA0);
        I915_WRITE(fpa1_reg, dev_priv->saveFPA1);
        /* Actually enable it */
        I915_WRITE(dpll_a_reg, dev_priv->saveDPLL_A);
-       DRM_UDELAY(150);
-       if (IS_I965G(dev) && !IS_IRONLAKE(dev))
+       POSTING_READ(dpll_a_reg);
+       udelay(150);
+       if (IS_I965G(dev) && !IS_IRONLAKE(dev)) {
                I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD);
-       DRM_UDELAY(150);
+               POSTING_READ(DPLL_A_MD);
+       }
+       udelay(150);
 
        /* Restore mode */
        I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A);
@@ -460,16 +464,20 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
        if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) {
                I915_WRITE(dpll_b_reg, dev_priv->saveDPLL_B &
                           ~DPLL_VCO_ENABLE);
-               DRM_UDELAY(150);
+               POSTING_READ(dpll_b_reg);
+               udelay(150);
        }
        I915_WRITE(fpb0_reg, dev_priv->saveFPB0);
        I915_WRITE(fpb1_reg, dev_priv->saveFPB1);
        /* Actually enable it */
        I915_WRITE(dpll_b_reg, dev_priv->saveDPLL_B);
-       DRM_UDELAY(150);
-       if (IS_I965G(dev) && !IS_IRONLAKE(dev))
+       POSTING_READ(dpll_b_reg);
+       udelay(150);
+       if (IS_I965G(dev) && !IS_IRONLAKE(dev)) {
                I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD);
-       DRM_UDELAY(150);
+               POSTING_READ(DPLL_B_MD);
+       }
+       udelay(150);
 
        /* Restore mode */
        I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B);
@@ -730,7 +738,8 @@ void i915_restore_display(struct drm_device *dev)
        I915_WRITE(VGA0, dev_priv->saveVGA0);
        I915_WRITE(VGA1, dev_priv->saveVGA1);
        I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
-       DRM_UDELAY(150);
+       POSTING_READ(VGA_PD);
+       udelay(150);
 
        i915_restore_vga(dev);
 }