diff options
-rw-r--r-- | sys/dev/drm/drm_irq.c | 13 |
1 files 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; |