drm/i915: Reduce hangcheck frequency
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 13 Sep 2010 22:44:34 +0000 (23:44 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 14 Sep 2010 09:30:10 +0000 (10:30 +0100)
By reducing the hangcheck frequency we check less often, conserving
resources, and still detect a lock up quickly. On a fast machine with a
slow GPU (like a Core2 paired with a 945G) it is easy for the hangcheck to
misfire as we check too fast.

Also once hung and if we fail to completely reset the chip, we have a
nasty habit of proclaming a hang many times a second and generating a
strobe-like display.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_irq.c

index 232555e33929e96fff2960eb559282938daf521a..70cbe3cee1ab4f56d4727cedc723f795a97f5d08 100644 (file)
@@ -299,7 +299,7 @@ typedef struct drm_i915_private {
        int num_pipe;
 
        /* For hangcheck timer */
-#define DRM_I915_HANGCHECK_PERIOD 75 /* in jiffies */
+#define DRM_I915_HANGCHECK_PERIOD 250 /* in ms */
        struct timer_list hangcheck_timer;
        int hangcheck_count;
        uint32_t last_acthd;
index e0b7ddc917c20f645d94860db7c2dd11c5bdfbe4..9391765af70df213992db7ad3f4beef376f15ce7 100644 (file)
@@ -1639,9 +1639,11 @@ i915_add_request(struct drm_device *dev,
        }
 
        if (!dev_priv->mm.suspended) {
-               mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD);
+               mod_timer(&dev_priv->hangcheck_timer,
+                         jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
                if (was_empty)
-                       queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
+                       queue_delayed_work(dev_priv->wq,
+                                          &dev_priv->mm.retire_work, HZ);
        }
        return seqno;
 }
index bc8438d6d84328a9834a8c2da5e763007ee3c764..e64b8eaa0b9d1a65996cccd910e24c468f10e016 100644 (file)
@@ -328,7 +328,8 @@ static irqreturn_t ironlake_irq_handler(struct drm_device *dev)
                trace_i915_gem_request_complete(dev, seqno);
                DRM_WAKEUP(&dev_priv->render_ring.irq_queue);
                dev_priv->hangcheck_count = 0;
-               mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD);
+               mod_timer(&dev_priv->hangcheck_timer,
+                         jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
        }
        if (gt_iir & GT_BSD_USER_INTERRUPT)
                DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue);
@@ -1018,7 +1019,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
                        trace_i915_gem_request_complete(dev, seqno);
                        DRM_WAKEUP(&dev_priv->render_ring.irq_queue);
                        dev_priv->hangcheck_count = 0;
-                       mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD);
+                       mod_timer(&dev_priv->hangcheck_timer,
+                                 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
                }
 
                if (HAS_BSD(dev) && (iir & I915_BSD_USER_INTERRUPT))
@@ -1394,7 +1396,8 @@ void i915_hangcheck_elapsed(unsigned long data)
 
 out:
        /* Reset timer case chip hangs without another request being added */
-       mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD);
+       mod_timer(&dev_priv->hangcheck_timer,
+                 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
 }
 
 /* drm_dma.h hooks