drm/i915: Apply HWSTAM workaround for BSD ring on SandyBridge
[deliverable/linux.git] / drivers / gpu / drm / i915 / i915_irq.c
index 349a03e48481b18739babed064f40118c37de842..ae2b49969b995c0b1c7f7f76f65d2426ea003522 100644 (file)
@@ -517,7 +517,7 @@ irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
        if (de_iir & DE_PIPEA_VBLANK_IVB)
                drm_handle_vblank(dev, 0);
 
-       if (de_iir & DE_PIPEB_VBLANK_IVB);
+       if (de_iir & DE_PIPEB_VBLANK_IVB)
                drm_handle_vblank(dev, 1);
 
        /* check event from PCH */
@@ -1736,8 +1736,21 @@ void ironlake_irq_preinstall(struct drm_device *dev)
 
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
+       if (IS_GEN6(dev) || IS_IVYBRIDGE(dev))
+               INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
        I915_WRITE(HWSTAM, 0xeffe);
+       if (IS_GEN6(dev)) {
+               /* Workaround stalls observed on Sandy Bridge GPUs by
+                * making the blitter command streamer generate a
+                * write to the Hardware Status Page for
+                * MI_USER_INTERRUPT.  This appears to serialize the
+                * previous seqno write out before the interrupt
+                * happens.
+                */
+               I915_WRITE(GEN6_BLITTER_HWSTAM, ~GEN6_BLITTER_USER_INTERRUPT);
+               I915_WRITE(GEN6_BSD_HWSTAM, ~GEN6_BSD_USER_INTERRUPT);
+       }
 
        /* XXX hotplug from PCH */
 
@@ -1887,7 +1900,6 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
 
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-       INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
        if (I915_HAS_HOTPLUG(dev)) {
                I915_WRITE(PORT_HOTPLUG_EN, 0);
This page took 0.024807 seconds and 5 git commands to generate.