[Intel-gfx] [PATCH 5/5] drm/i915: Hookup chip reset in error handler

Ben Gamari bgamari.foss at gmail.com
Sat Jul 11 22:48:07 CEST 2009


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 at gmail.com>
---
 drivers/gpu/drm/i915/i915_irq.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index f36a6f7..67f38db 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");
+		}
+	}
 }
 
 /**
-- 
1.6.3.3




More information about the Intel-gfx mailing list