aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_irq.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 724e505873cf..477caa1b1e4b 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -267,7 +267,8 @@ EXPORT_SYMBOL(drm_irq_install);
267 */ 267 */
268int drm_irq_uninstall(struct drm_device * dev) 268int drm_irq_uninstall(struct drm_device * dev)
269{ 269{
270 int irq_enabled; 270 unsigned long irqflags;
271 int irq_enabled, i;
271 272
272 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) 273 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
273 return -EINVAL; 274 return -EINVAL;
@@ -277,6 +278,16 @@ int drm_irq_uninstall(struct drm_device * dev)
277 dev->irq_enabled = 0; 278 dev->irq_enabled = 0;
278 mutex_unlock(&dev->struct_mutex); 279 mutex_unlock(&dev->struct_mutex);
279 280
281 /*
282 * Wake up any waiters so they don't hang.
283 */
284 spin_lock_irqsave(&dev->vbl_lock, irqflags);
285 for (i = 0; i < dev->num_crtcs; i++) {
286 DRM_WAKEUP(&dev->vbl_queue[i]);
287 dev->vblank_enabled[i] = 0;
288 }
289 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
290
280 if (!irq_enabled) 291 if (!irq_enabled)
281 return -EINVAL; 292 return -EINVAL;
282 293
@@ -652,8 +663,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
652 vblwait->request.sequence, crtc); 663 vblwait->request.sequence, crtc);
653 dev->last_vblank_wait[crtc] = vblwait->request.sequence; 664 dev->last_vblank_wait[crtc] = vblwait->request.sequence;
654 DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, 665 DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
655 ((drm_vblank_count(dev, crtc) 666 (((drm_vblank_count(dev, crtc) -
656 - vblwait->request.sequence) <= (1 << 23))); 667 vblwait->request.sequence) <= (1 << 23)) ||
668 !dev->irq_enabled));
657 669
658 if (ret != -EINTR) { 670 if (ret != -EINTR) {
659 struct timeval now; 671 struct timeval now;