diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2014-02-25 17:11:27 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-05 21:30:26 +0100 |
commit | 48b031e30d46b11fdf7a8075f02f5f9eef728f4d (patch) | |
tree | 6c773c0fb3f3024666c11789128e132de49df31d | |
parent | 581744626d89930a03f307558182896a4f51173c (diff) | |
download | talos-op-linux-48b031e30d46b11fdf7a8075f02f5f9eef728f4d.tar.gz talos-op-linux-48b031e30d46b11fdf7a8075f02f5f9eef728f4d.zip |
drm/i915: Add reset count to error state
By default we keep only the error state from first hang. However
some sneaky user might have cleared the first error state and we
assume mistakenly that it is from first hang. As sometimes this
matters, it is better to explicitly store the reset count.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gpu_error.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 2b0da9592fe8..a6429cc93d1a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -304,6 +304,7 @@ struct drm_i915_error_state { struct timeval time; char error_msg[128]; + u32 reset_count; /* Generic register state */ u32 eir; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 7b2afa00bccb..353f0770da8f 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -347,6 +347,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, error->ring[i].pid); } } + err_printf(m, "Reset count: %u\n", error->reset_count); err_printf(m, "PCI ID: 0x%04x\n", dev->pdev->device); err_printf(m, "EIR: 0x%08x\n", error->eir); err_printf(m, "IER: 0x%08x\n", error->ier); @@ -1120,6 +1121,12 @@ static void i915_error_capture_msg(struct drm_device *dev, wedged ? "reset" : "continue"); } +static void i915_capture_gen_state(struct drm_i915_private *dev_priv, + struct drm_i915_error_state *error) +{ + error->reset_count = i915_reset_count(&dev_priv->gpu_error); +} + /** * i915_capture_error_state - capture an error record for later analysis * @dev: drm device @@ -1146,6 +1153,7 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged, kref_init(&error->ref); + i915_capture_gen_state(dev_priv, error); i915_capture_reg_state(dev_priv, error); i915_gem_capture_buffers(dev_priv, error); i915_gem_record_fences(dev, error); |