r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
authorTilman Sauerbeck <tilman@code-monkey.de>
Fri, 29 Oct 2010 17:29:54 +0000 (19:29 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Tue, 2 Nov 2010 20:52:38 +0000 (21:52 +0100)
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
src/gallium/winsys/r600/drm/radeon_bo_pb.c

index 4454f5213aad948595daa43b8cfb03c61e049560..f74b934c374d96a06b4a2b5354aba58ecfdec471 100644 (file)
@@ -80,7 +80,7 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf,
        struct pipe_context *pctx = ctx;
 
        if (flags & PB_USAGE_UNSYNCHRONIZED) {
-               if (!buf->bo->data && radeon_bo_map(buf->mgr->radeon, buf->bo)) {
+               if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
                        return NULL;
                }
                LIST_DELINIT(&buf->maplist);
@@ -106,18 +106,12 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf,
                goto out;
        }
 
-       if (buf->bo->data != NULL) {
-               if (radeon_bo_wait(buf->mgr->radeon, buf->bo)) {
-                       return NULL;
-               }
-       } else {
-               if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
-                       return NULL;
-               }
-               if (radeon_bo_wait(buf->mgr->radeon, buf->bo)) {
-                       radeon_bo_unmap(buf->mgr->radeon, buf->bo);
-                       return NULL;
-               }
+       if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
+               return NULL;
+       }
+       if (radeon_bo_wait(buf->mgr->radeon, buf->bo)) {
+               radeon_bo_unmap(buf->mgr->radeon, buf->bo);
+               return NULL;
        }
 out:
        LIST_DELINIT(&buf->maplist);