diff options
author | rnoland <rnoland@FreeBSD.org> | 2009-03-26 02:10:18 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2009-03-26 02:10:18 +0000 |
commit | 71edadf45e484b56b2e982f076c053a77db18471 (patch) | |
tree | b2cfdef3ee2cae065461466f64f96dfc43ec02db /sys/dev/drm | |
parent | 43475c65b23901769f07fa6e198d08ec78100c5d (diff) | |
download | FreeBSD-src-71edadf45e484b56b2e982f076c053a77db18471.zip FreeBSD-src-71edadf45e484b56b2e982f076c053a77db18471.tar.gz |
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
Diffstat (limited to 'sys/dev/drm')
-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; |