]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdrm.git/commitdiff
radeon: fix bo wait at map time.
authorDave Airlie <airlied@redhat.com>
Mon, 17 Aug 2009 11:21:02 +0000 (21:21 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 17 Aug 2009 11:21:53 +0000 (21:21 +1000)
libdrm/radeon/radeon_bo_gem.c

index 3c3b3e5b55d6ac10150efbb1784271dc71cdba1c..cf59a359b653c570435c27851d8523653fcc434f 100644 (file)
@@ -156,11 +156,7 @@ static int bo_map(struct radeon_bo *bo, int write)
         return 0;
     }
     if (bo_gem->priv_ptr) {
-       r = bo_wait(bo);
-       bo->ptr = bo_gem->priv_ptr;
-       if (r)
-               return r;
-       return 0;
+       goto wait;
     }
 
     bo->ptr = NULL;
@@ -180,8 +176,12 @@ static int bo_map(struct radeon_bo *bo, int write)
     if (ptr == MAP_FAILED)
         return -errno;
     bo_gem->priv_ptr = ptr;
+wait:
     bo->ptr = bo_gem->priv_ptr;
-    return r;
+    r = bo_wait(bo);
+    if (r)
+       return r;
+    return 0;
 }
 
 static int bo_unmap(struct radeon_bo *bo)