diff options
author | Tilman Sauerbeck <[email protected]> | 2010-10-29 19:29:54 +0200 |
---|---|---|
committer | Tilman Sauerbeck <[email protected]> | 2010-11-02 21:52:38 +0100 |
commit | b675266f0e144fd8cd08600c72a8207ce50b25e8 (patch) | |
tree | 504d0dcbf51ef5a9a5c6c43aa4a9b1389d65cc4f /src/gallium/winsys | |
parent | 4e34393162660a8429ef33e6ec48cfdd01090d70 (diff) |
r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
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 <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_bo_pb.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon_bo_pb.c b/src/gallium/winsys/r600/drm/radeon_bo_pb.c index 4454f5213aa..f74b934c374 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo_pb.c +++ b/src/gallium/winsys/r600/drm/radeon_bo_pb.c @@ -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); |