diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-27 08:18:12 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-05-28 13:39:25 -0400 |
commit | 35aed2e6be2feaa227fe5c7a0b7c286c4fe71592 (patch) | |
tree | fdf177a0abea4ee6fba09c3381a2b73ce18c8dbd | |
parent | e20f9c64c79e2282f9eb531509181965ec8f0a92 (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index b5dba4795f6f..2479be001e40 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -692,24 +692,13 @@ void i915_destroy_error_state(struct drm_device *dev) | |||
692 | i915_error_state_free(dev, error); | 692 | i915_error_state_free(dev, error); |
693 | } | 693 | } |
694 | 694 | ||
695 | /** | 695 | static void i915_report_and_clear_eir(struct drm_device *dev) |
696 | * i915_handle_error - handle an error interrupt | ||
697 | * @dev: drm device | ||
698 | * | ||
699 | * Do some basic checking of regsiter state at error interrupt time and | ||
700 | * dump it to the syslog. Also call i915_capture_error_state() to make | ||
701 | * sure we get a record and make it available in debugfs. Fire a uevent | ||
702 | * so userspace knows something bad happened (should trigger collection | ||
703 | * of a ring dump etc.). | ||
704 | */ | ||
705 | static void i915_handle_error(struct drm_device *dev, bool wedged) | ||
706 | { | 696 | { |
707 | struct drm_i915_private *dev_priv = dev->dev_private; | 697 | struct drm_i915_private *dev_priv = dev->dev_private; |
708 | u32 eir = I915_READ(EIR); | 698 | u32 eir = I915_READ(EIR); |
709 | u32 pipea_stats = I915_READ(PIPEASTAT); | ||
710 | u32 pipeb_stats = I915_READ(PIPEBSTAT); | ||
711 | 699 | ||
712 | i915_capture_error_state(dev); | 700 | if (!eir) |
701 | return; | ||
713 | 702 | ||
714 | printk(KERN_ERR "render error detected, EIR: 0x%08x\n", | 703 | printk(KERN_ERR "render error detected, EIR: 0x%08x\n", |
715 | eir); | 704 | eir); |
@@ -755,6 +744,9 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
755 | } | 744 | } |
756 | 745 | ||
757 | if (eir & I915_ERROR_MEMORY_REFRESH) { | 746 | if (eir & I915_ERROR_MEMORY_REFRESH) { |
747 | u32 pipea_stats = I915_READ(PIPEASTAT); | ||
748 | u32 pipeb_stats = I915_READ(PIPEBSTAT); | ||
749 | |||
758 | printk(KERN_ERR "memory refresh error\n"); | 750 | printk(KERN_ERR "memory refresh error\n"); |
759 | printk(KERN_ERR "PIPEASTAT: 0x%08x\n", | 751 | printk(KERN_ERR "PIPEASTAT: 0x%08x\n", |
760 | pipea_stats); | 752 | pipea_stats); |
@@ -811,6 +803,24 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
811 | I915_WRITE(EMR, I915_READ(EMR) | eir); | 803 | I915_WRITE(EMR, I915_READ(EMR) | eir); |
812 | I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); | 804 | I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); |
813 | } | 805 | } |
806 | } | ||
807 | |||
808 | /** | ||
809 | * i915_handle_error - handle an error interrupt | ||
810 | * @dev: drm device | ||
811 | * | ||
812 | * Do some basic checking of regsiter state at error interrupt time and | ||
813 | * dump it to the syslog. Also call i915_capture_error_state() to make | ||
814 | * sure we get a record and make it available in debugfs. Fire a uevent | ||
815 | * so userspace knows something bad happened (should trigger collection | ||
816 | * of a ring dump etc.). | ||
817 | */ | ||
818 | static void i915_handle_error(struct drm_device *dev, bool wedged) | ||
819 | { | ||
820 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
821 | |||
822 | i915_capture_error_state(dev); | ||
823 | i915_report_and_clear_eir(dev); | ||
814 | 824 | ||
815 | if (wedged) { | 825 | if (wedged) { |
816 | atomic_set(&dev_priv->mm.wedged, 1); | 826 | atomic_set(&dev_priv->mm.wedged, 1); |