From 71edadf45e484b56b2e982f076c053a77db18471 Mon Sep 17 00:00:00 2001 From: rnoland Date: Thu, 26 Mar 2009 02:10:18 +0000 Subject: Fix up waiting on vblank again... This reverts a last minute change that I made on the last patch, it seems to upset suspend/resume and shutdown. MFC after: 3 days --- sys/dev/drm/drm_irq.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/drm/drm_irq.c b/sys/dev/drm/drm_irq.c index 44b8100..a13192c 100644 --- a/sys/dev/drm/drm_irq.c +++ b/sys/dev/drm/drm_irq.c @@ -463,16 +463,19 @@ int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_pr } else { DRM_DEBUG("waiting on vblank count %d, crtc %d\n", vblwait->request.sequence, crtc); - mtx_lock(&dev->irq_lock); dev->vblank[crtc].last = vblwait->request.sequence; for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) - vblwait->request.sequence) <= (1 << 23)) || !dev->irq_enabled) ; ) { - ret = mtx_sleep(&dev->vblank[crtc].queue, - &dev->irq_lock, PCATCH, "vblwtq", - 3 * DRM_HZ); + mtx_lock(&dev->irq_lock); + if (!(((drm_vblank_count(dev, crtc) - + vblwait->request.sequence) <= (1 << 23)) || + !dev->irq_enabled)) + ret = mtx_sleep(&dev->vblank[crtc].queue, + &dev->irq_lock, PCATCH, "vblwtq", + 3 * DRM_HZ); + mtx_unlock(&dev->irq_lock); } - mtx_unlock(&dev->irq_lock); if (ret != EINTR && ret != ERESTART) { struct timeval now; -- cgit v1.1