i915 gem: install and uninstall irq handler in entervt and leavevt ioctls.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index bb6e5a3..5fe5034 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2443,6 +2443,9 @@
 	BUG_ON(!list_empty(&dev_priv->mm.request_list));
 	dev_priv->mm.suspended = 0;
 	mutex_unlock(&dev->struct_mutex);
+
+	drm_irq_install(dev);
+
 	return 0;
 }
 
@@ -2458,6 +2461,8 @@
 		i915_gem_cleanup_ringbuffer(dev);
 	mutex_unlock(&dev->struct_mutex);
 
+	drm_irq_uninstall(dev);
+
 	return 0;
 }
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1469a1b..51ee72c 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1134,6 +1134,7 @@
 extern int drm_control(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv);
 extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS);
+extern int drm_irq_install(struct drm_device *dev);
 extern int drm_irq_uninstall(struct drm_device *dev);
 extern void drm_driver_irq_preinstall(struct drm_device *dev);
 extern void drm_driver_irq_postinstall(struct drm_device *dev);