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

Robert Noland rnoland at FreeBSD.org
Thu Jun 25 19:23:26 UTC 2009


Author: rnoland
Date: Thu Jun 25 19:23:25 2009
New Revision: 194996
URL: http://svn.freebsd.org/changeset/base/194996

Log:
  We shouldn't need to drop and reaquire the lock here.
  
  MFC after:	3 days

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

Modified: head/sys/dev/drm/i915_dma.c
==============================================================================
--- head/sys/dev/drm/i915_dma.c	Thu Jun 25 19:16:29 2009	(r194995)
+++ head/sys/dev/drm/i915_dma.c	Thu Jun 25 19:23:25 2009	(r194996)
@@ -644,18 +644,17 @@ static int i915_batchbuffer(struct drm_d
 			return -EFAULT;
 		}
 	}
-	DRM_LOCK();
 
 	ret = i915_dispatch_batchbuffer(dev, batch);
 
-	if (sarea_priv)
-		sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
-
-	DRM_UNLOCK();
 	if (batch->num_cliprects)
 		vsunlock(batch->cliprects, cliplen);
+
 	DRM_LOCK();
 
+	if (sarea_priv)
+		sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
+
 	return ret;
 }
 
@@ -697,10 +696,9 @@ static int i915_cmdbuffer(struct drm_dev
 			return -EFAULT;
 		}
 	}
-	DRM_LOCK();
 
 	ret = i915_dispatch_cmdbuffer(dev, cmdbuf);
-	DRM_UNLOCK();
+
 	if (cmdbuf->num_cliprects) {
 		vsunlock(cmdbuf->buf, cmdbuf->sz);
 		vsunlock(cmdbuf->cliprects, cliplen);


More information about the svn-src-all mailing list