提交 35aed2e6 编写于 作者: C Chris Wilson 提交者: Eric Anholt

drm/i915: Only print an message if there was an error

Only report an error if the GPU has actually detected one, otherwise we
are just hung.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 e20f9c64
...@@ -692,24 +692,13 @@ void i915_destroy_error_state(struct drm_device *dev) ...@@ -692,24 +692,13 @@ void i915_destroy_error_state(struct drm_device *dev)
i915_error_state_free(dev, error); i915_error_state_free(dev, error);
} }
/** static void i915_report_and_clear_eir(struct drm_device *dev)
* i915_handle_error - handle an error interrupt
* @dev: drm device
*
* Do some basic checking of regsiter state at error interrupt time and
* dump it to the syslog. Also call i915_capture_error_state() to make
* sure we get a record and make it available in debugfs. Fire a uevent
* so userspace knows something bad happened (should trigger collection
* of a ring dump etc.).
*/
static void i915_handle_error(struct drm_device *dev, bool wedged)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
u32 eir = I915_READ(EIR); u32 eir = I915_READ(EIR);
u32 pipea_stats = I915_READ(PIPEASTAT);
u32 pipeb_stats = I915_READ(PIPEBSTAT);
i915_capture_error_state(dev); if (!eir)
return;
printk(KERN_ERR "render error detected, EIR: 0x%08x\n", printk(KERN_ERR "render error detected, EIR: 0x%08x\n",
eir); eir);
...@@ -755,6 +744,9 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) ...@@ -755,6 +744,9 @@ static void i915_handle_error(struct drm_device *dev, bool wedged)
} }
if (eir & I915_ERROR_MEMORY_REFRESH) { if (eir & I915_ERROR_MEMORY_REFRESH) {
u32 pipea_stats = I915_READ(PIPEASTAT);
u32 pipeb_stats = I915_READ(PIPEBSTAT);
printk(KERN_ERR "memory refresh error\n"); printk(KERN_ERR "memory refresh error\n");
printk(KERN_ERR "PIPEASTAT: 0x%08x\n", printk(KERN_ERR "PIPEASTAT: 0x%08x\n",
pipea_stats); pipea_stats);
...@@ -811,6 +803,24 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) ...@@ -811,6 +803,24 @@ static void i915_handle_error(struct drm_device *dev, bool wedged)
I915_WRITE(EMR, I915_READ(EMR) | eir); I915_WRITE(EMR, I915_READ(EMR) | eir);
I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT);
} }
}
/**
* i915_handle_error - handle an error interrupt
* @dev: drm device
*
* Do some basic checking of regsiter state at error interrupt time and
* dump it to the syslog. Also call i915_capture_error_state() to make
* sure we get a record and make it available in debugfs. Fire a uevent
* so userspace knows something bad happened (should trigger collection
* of a ring dump etc.).
*/
static void i915_handle_error(struct drm_device *dev, bool wedged)
{
struct drm_i915_private *dev_priv = dev->dev_private;
i915_capture_error_state(dev);
i915_report_and_clear_eir(dev);
if (wedged) { if (wedged) {
atomic_set(&dev_priv->mm.wedged, 1); atomic_set(&dev_priv->mm.wedged, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册