aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2009-09-14 17:48:46 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 17:36:30 -0400
commitf316a42cc49eca73b33d85feb6177e32431747ff (patch)
treed335898e54b08bb04304a1fa462cb50744665fe1 /drivers
parent11ed50ec2a316928c2bacc1149bded86c6a96068 (diff)
drm/i915: Hookup chip reset in error handler
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> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 2a042bc173fe..8f5276614ce2 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -302,12 +302,25 @@ static void i915_error_work_func(struct work_struct *work)
302 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t, 302 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
303 error_work); 303 error_work);
304 struct drm_device *dev = dev_priv->dev; 304 struct drm_device *dev = dev_priv->dev;
305 char *event_string = "ERROR=1"; 305 char *error_event[] = { "ERROR=1", NULL };
306 char *envp[] = { event_string, NULL }; 306 char *reset_event[] = { "RESET=1", NULL };
307 char *reset_done_event[] = { "ERROR=0", NULL };
307 308
308 DRM_DEBUG("generating error event\n"); 309 DRM_DEBUG("generating error event\n");
310 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event);
309 311
310 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp); 312 if (dev_priv->mm.wedged) {
313 if (IS_I965G(dev)) {
314 DRM_DEBUG("resetting chip\n");
315 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event);
316 if (!i965_reset(dev, GDRST_RENDER)) {
317 dev_priv->mm.wedged = 0;
318 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event);
319 }
320 } else {
321 printk("reboot required\n");
322 }
323 }
311} 324}
312 325
313/** 326/**