diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2009-09-14 17:48:44 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-17 17:36:01 -0400 |
commit | f65d94211e2bcba17faf05a6a3809af0e4217767 (patch) | |
tree | a040777b0311b5c5a7a26f64c7d8ae9a6ac872f1 /drivers/gpu/drm/i915/i915_drv.h | |
parent | 22be172423b0007a02a06d70db8aeb4d9e64c6b3 (diff) |
drm/i915: Add hangcheck timer
We set a periodic timer to check on the GPU, resetting it every time a
batch is completed. If the timer elapses, we check acthd. If acthd
hasn't changed in two timer periods, we assume the chip is wedged.
This is implemented in such a way that it leaves the option open to
employ adaptive timer intervals in the future. One could wait until
several timer periods have elapsed before declaring the chip dead. If
the chip comes back after several periods but before the "dead"
threshold, the timer interval or dead threshold could be raised.
It is important to note that while checking for active requests, we need
to account for the fact that requests are removed from the list (i.e.
retired) in a deferred work queue handler. This means that merely
checking for an empty request_list is insufficient; the list could be
non-empty yet the GPU still idle, causing the hangcheck timer to
incorrectly mark the GPU as wedged (it took me a while to figure that
out---sigh...)
Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 933d832aeff7..afbcaa9866f4 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -203,6 +203,12 @@ typedef struct drm_i915_private { | |||
203 | unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds; | 203 | unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds; |
204 | int vblank_pipe; | 204 | int vblank_pipe; |
205 | 205 | ||
206 | /* For hangcheck timer */ | ||
207 | #define DRM_I915_HANGCHECK_PERIOD 75 /* in jiffies */ | ||
208 | struct timer_list hangcheck_timer; | ||
209 | int hangcheck_count; | ||
210 | uint32_t last_acthd; | ||
211 | |||
206 | bool cursor_needs_physical; | 212 | bool cursor_needs_physical; |
207 | 213 | ||
208 | struct drm_mm vram; | 214 | struct drm_mm vram; |
@@ -620,6 +626,7 @@ extern int i915_emit_box(struct drm_device *dev, | |||
620 | int i, int DR1, int DR4); | 626 | int i, int DR1, int DR4); |
621 | 627 | ||
622 | /* i915_irq.c */ | 628 | /* i915_irq.c */ |
629 | void i915_hangcheck_elapsed(unsigned long data); | ||
623 | extern int i915_irq_emit(struct drm_device *dev, void *data, | 630 | extern int i915_irq_emit(struct drm_device *dev, void *data, |
624 | struct drm_file *file_priv); | 631 | struct drm_file *file_priv); |
625 | extern int i915_irq_wait(struct drm_device *dev, void *data, | 632 | extern int i915_irq_wait(struct drm_device *dev, void *data, |