svn commit: r190433 - head/sys/dev/drm

Robert Noland rnoland at FreeBSD.org
Wed Mar 25 19:10:19 PDT 2009


Author: rnoland
Date: Thu Mar 26 02:10:18 2009
New Revision: 190433
URL: http://svn.freebsd.org/changeset/base/190433

Log:
  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

Modified:
  head/sys/dev/drm/drm_irq.c

Modified: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Wed Mar 25 23:20:49 2009	(r190432)
+++ head/sys/dev/drm/drm_irq.c	Thu Mar 26 02:10:18 2009	(r190433)
@@ -463,16 +463,19 @@ int drm_wait_vblank(struct drm_device *d
 	} 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;


More information about the svn-src-head mailing list