drm/i915: Propagate error from drm_install_irq() during EnterVT
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 7 Jun 2010 13:03:03 +0000 (14:03 +0100)
committerEric Anholt <eric@anholt.net>
Mon, 2 Aug 2010 02:03:44 +0000 (19:03 -0700)
Simple fix for error propagation along the old UMS path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_gem.c

index 8004dc95c3a8301cc22bffb0107ef486bd3fbadf..0bf4bcd53e97b224624f7fbbcac59a2ebf51d53e 100644 (file)
@@ -4687,9 +4687,19 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
        BUG_ON(HAS_BSD(dev) && !list_empty(&dev_priv->bsd_ring.request_list));
        mutex_unlock(&dev->struct_mutex);
 
-       drm_irq_install(dev);
+       ret = drm_irq_install(dev);
+       if (ret)
+               goto cleanup_ringbuffer;
 
        return 0;
+
+cleanup_ringbuffer:
+       mutex_lock(&dev->struct_mutex);
+       i915_gem_cleanup_ringbuffer(dev);
+       dev_priv->mm.suspended = 1;
+       mutex_unlock(&dev->struct_mutex);
+
+       return ret;
 }
 
 int