aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-13 18:44:34 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-14 05:30:10 -0400
commitb3b079dbef06c7f775178d561a4c8e47b7447139 (patch)
tree90b76ae31d7330d79ce98e1cea98d4a198e4c47c /drivers/gpu/drm/i915
parente2e767abd85806d05a5266b3b112baaf80ee3382 (diff)
drm/i915: Reduce hangcheck frequency
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>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c6
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c9
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 232555e33929..70cbe3cee1ab 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -299,7 +299,7 @@ typedef struct drm_i915_private {
299 int num_pipe; 299 int num_pipe;
300 300
301 /* For hangcheck timer */ 301 /* For hangcheck timer */
302#define DRM_I915_HANGCHECK_PERIOD 75 /* in jiffies */ 302#define DRM_I915_HANGCHECK_PERIOD 250 /* in ms */
303 struct timer_list hangcheck_timer; 303 struct timer_list hangcheck_timer;
304 int hangcheck_count; 304 int hangcheck_count;
305 uint32_t last_acthd; 305 uint32_t last_acthd;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e0b7ddc917c2..9391765af70d 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1639,9 +1639,11 @@ i915_add_request(struct drm_device *dev,
1639 } 1639 }
1640 1640
1641 if (!dev_priv->mm.suspended) { 1641 if (!dev_priv->mm.suspended) {
1642 mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); 1642 mod_timer(&dev_priv->hangcheck_timer,
1643 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
1643 if (was_empty) 1644 if (was_empty)
1644 queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ); 1645 queue_delayed_work(dev_priv->wq,
1646 &dev_priv->mm.retire_work, HZ);
1645 } 1647 }
1646 return seqno; 1648 return seqno;
1647} 1649}
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index bc8438d6d843..e64b8eaa0b9d 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -328,7 +328,8 @@ static irqreturn_t ironlake_irq_handler(struct drm_device *dev)
328 trace_i915_gem_request_complete(dev, seqno); 328 trace_i915_gem_request_complete(dev, seqno);
329 DRM_WAKEUP(&dev_priv->render_ring.irq_queue); 329 DRM_WAKEUP(&dev_priv->render_ring.irq_queue);
330 dev_priv->hangcheck_count = 0; 330 dev_priv->hangcheck_count = 0;
331 mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); 331 mod_timer(&dev_priv->hangcheck_timer,
332 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
332 } 333 }
333 if (gt_iir & GT_BSD_USER_INTERRUPT) 334 if (gt_iir & GT_BSD_USER_INTERRUPT)
334 DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); 335 DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue);
@@ -1018,7 +1019,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
1018 trace_i915_gem_request_complete(dev, seqno); 1019 trace_i915_gem_request_complete(dev, seqno);
1019 DRM_WAKEUP(&dev_priv->render_ring.irq_queue); 1020 DRM_WAKEUP(&dev_priv->render_ring.irq_queue);
1020 dev_priv->hangcheck_count = 0; 1021 dev_priv->hangcheck_count = 0;
1021 mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); 1022 mod_timer(&dev_priv->hangcheck_timer,
1023 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
1022 } 1024 }
1023 1025
1024 if (HAS_BSD(dev) && (iir & I915_BSD_USER_INTERRUPT)) 1026 if (HAS_BSD(dev) && (iir & I915_BSD_USER_INTERRUPT))
@@ -1394,7 +1396,8 @@ void i915_hangcheck_elapsed(unsigned long data)
1394 1396
1395out: 1397out:
1396 /* Reset timer case chip hangs without another request being added */ 1398 /* Reset timer case chip hangs without another request being added */
1397 mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); 1399 mod_timer(&dev_priv->hangcheck_timer,
1400 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
1398} 1401}
1399 1402
1400/* drm_dma.h hooks 1403/* drm_dma.h hooks