Mesa (master): ws/r600: match bo_busy shared/fence logic in bo_wait

Keith Whitwell keithw at kemper.freedesktop.org
Wed Nov 10 03:06:02 PST 2010


Module: Mesa
Branch: master
Commit: 9a04eca2f865dc3eca31b34ae570cd489b18c240
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a04eca2f865dc3eca31b34ae570cd489b18c240

Author: Keith Whitwell <keithw at vmware.com>
Date:   Wed Nov 10 11:03:07 2010 +0000

ws/r600: match bo_busy shared/fence logic in bo_wait

Fixes crash in piglit depthrange-clear.

---

 src/gallium/winsys/r600/drm/radeon_bo.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c
index 3054782..557cfb9 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo.c
@@ -153,14 +153,15 @@ int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo)
 	struct drm_radeon_gem_wait_idle args;
 	int ret;
 
-	if (!bo->fence && !bo->shared)
-		return 0;
-
-	if (bo->fence <= *bo->ctx->cfence) {
-		LIST_DELINIT(&bo->fencedlist);
-		bo->fence = 0;
-		return 0;
-	}
+        if (!bo->shared) {
+                if (!bo->fence)
+			return 0;
+		if (bo->fence <= *bo->ctx->cfence) {
+			LIST_DELINIT(&bo->fencedlist);
+			bo->fence = 0;
+			return 0;
+		}
+        }
 
 	/* Zero out args to make valgrind happy */
 	memset(&args, 0, sizeof(args));



More information about the mesa-commit mailing list