diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-18 19:56:52 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-07-01 13:50:02 -0400 |
commit | 63eeaf38251183ec2b1caee11e4a2c040cb5ce6c (patch) | |
tree | fca34774fbd842612f4e366afa6b037b0f3f39ea /drivers/gpu/drm/i915/i915_gem_debugfs.c | |
parent | e83c2b0ff325f52dda1aff3572d0e1516216c54b (diff) |
drm/i915: enable error detection & state collection
This patch enables error detection by enabling several types of error
interrupts. When an error interrupt is received, the interrupt
handler captures the error state; hopefully resulting in an accurate
set of error data (error type, active head pointer, etc.). The new
record is then available from sysfs. The current code will also dump
the error state to the system log.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_debugfs.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c index 28146e405e87..cacae945338b 100644 --- a/drivers/gpu/drm/i915/i915_gem_debugfs.c +++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c | |||
@@ -323,6 +323,39 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data) | |||
323 | return 0; | 323 | return 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int i915_error_state(struct seq_file *m, void *unused) | ||
327 | { | ||
328 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
329 | struct drm_device *dev = node->minor->dev; | ||
330 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
331 | struct drm_i915_error_state *error; | ||
332 | unsigned long flags; | ||
333 | |||
334 | spin_lock_irqsave(&dev_priv->error_lock, flags); | ||
335 | if (!dev_priv->first_error) { | ||
336 | seq_printf(m, "no error state collected\n"); | ||
337 | goto out; | ||
338 | } | ||
339 | |||
340 | error = dev_priv->first_error; | ||
341 | |||
342 | seq_printf(m, "EIR: 0x%08x\n", error->eir); | ||
343 | seq_printf(m, " PGTBL_ER: 0x%08x\n", error->pgtbl_er); | ||
344 | seq_printf(m, " INSTPM: 0x%08x\n", error->instpm); | ||
345 | seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir); | ||
346 | seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr); | ||
347 | seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone); | ||
348 | seq_printf(m, " ACTHD: 0x%08x\n", error->acthd); | ||
349 | if (IS_I965G(dev)) { | ||
350 | seq_printf(m, " INSTPS: 0x%08x\n", error->instps); | ||
351 | seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1); | ||
352 | } | ||
353 | |||
354 | out: | ||
355 | spin_unlock_irqrestore(&dev_priv->error_lock, flags); | ||
356 | |||
357 | return 0; | ||
358 | } | ||
326 | 359 | ||
327 | static struct drm_info_list i915_gem_debugfs_list[] = { | 360 | static struct drm_info_list i915_gem_debugfs_list[] = { |
328 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, | 361 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, |
@@ -336,6 +369,7 @@ static struct drm_info_list i915_gem_debugfs_list[] = { | |||
336 | {"i915_ringbuffer_data", i915_ringbuffer_data, 0}, | 369 | {"i915_ringbuffer_data", i915_ringbuffer_data, 0}, |
337 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, | 370 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, |
338 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, | 371 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, |
372 | {"i915_error_state", i915_error_state, 0}, | ||
339 | }; | 373 | }; |
340 | #define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) | 374 | #define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) |
341 | 375 | ||