drm/i915: Make the RPS interrupt generation mask handle the vlv wa
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Jul 2014 19:31:19 +0000 (20:31 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Jul 2014 20:30:40 +0000 (22:30 +0200)
We can eliminate a lot of special case code by making the computation of
the interrupt mask be correct for all callers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c

index 55228df5cf23ec6e2273cd96400b9fb9f5e31043..780c3ab26f4f0a4e765f1b4f9de6952ee1b1b1b2 100644 (file)
@@ -3183,6 +3183,9 @@ static u32 gen6_rps_pm_mask(struct drm_i915_private *dev_priv, u8 val)
        if (val < dev_priv->rps.max_freq_softlimit)
                mask |= GEN6_PM_RP_UP_THRESHOLD;
 
+       mask |= dev_priv->pm_rps_events & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED);
+       mask &= dev_priv->pm_rps_events;
+
        /* IVB and SNB hard hangs on looping batchbuffer
         * if GEN6_PM_UP_EI_EXPIRED is masked.
         */
@@ -3276,11 +3279,8 @@ static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)
 
        vlv_force_gfx_clock(dev_priv, false);
 
-       if (dev_priv->pm_rps_events & GEN6_PM_RP_UP_EI_EXPIRED)
-               I915_WRITE(GEN6_PMINTRMSK, ~dev_priv->pm_rps_events);
-       else 
-               I915_WRITE(GEN6_PMINTRMSK,
-                          gen6_rps_pm_mask(dev_priv, dev_priv->rps.cur_freq));
+       I915_WRITE(GEN6_PMINTRMSK,
+                  gen6_rps_pm_mask(dev_priv, dev_priv->rps.cur_freq));
 }
 
 void gen6_rps_idle(struct drm_i915_private *dev_priv)