diff mbox

[7/8] drm/i915: Hookup chip reset in error handler

Message ID 1249763687-5252-8-git-send-email-bgamari.foss@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ben Gamari Aug. 8, 2009, 8:34 p.m. UTC
This patch uses the previously introduced chip reset logic to reset the
chip when an error event is detected.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
 drivers/gpu/drm/i915/i915_irq.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6e234ad..03dc8ac 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -308,6 +308,18 @@  static void i915_error_work_func(struct work_struct *work)
 	DRM_DEBUG("generating error event\n");
 
 	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
+
+	if (dev_priv->mm.wedged) {
+		printk(KERN_ERR "GPU hang detected...");
+		if (IS_I965G(dev)) {
+			printk("resetting...");
+			i965_reset(dev, GDRST_RENDER);
+			printk("done.\n");
+			dev_priv->mm.wedged = 0;
+		} else {
+			printk("reboot required\n");
+		}
+	}
 }
 
 /**