diff options
author | Henri Verbeet <[email protected]> | 2010-09-19 19:27:30 +0200 |
---|---|---|
committer | Henri Verbeet <[email protected]> | 2010-09-19 19:43:05 +0200 |
commit | affd46cc2bb327490fbc6a96f936dccf82d4996d (patch) | |
tree | 63f255c678b1d847cb048bce5c2413476bd2a41b /src/gallium/winsys | |
parent | de9c8015eb30bf8a7e8571e7ca85e985173b0695 (diff) |
r600g: Buffer object maps imply a wait.
Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_bo_pb.c | 20 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_ws_bo.c | 11 |
2 files changed, 13 insertions, 18 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon_bo_pb.c b/src/gallium/winsys/r600/drm/radeon_bo_pb.c index 8cf6a781306..b8744b00eb4 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo_pb.c +++ b/src/gallium/winsys/r600/drm/radeon_bo_pb.c @@ -63,20 +63,26 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf, } } - if (buf->bo->data != NULL) { - LIST_DELINIT(&buf->maplist); - return buf->bo->data; - } - if (flags & PB_USAGE_DONTBLOCK) { uint32_t domain; if (radeon_bo_busy(buf->mgr->radeon, buf->bo, &domain)) return NULL; } - if (radeon_bo_map(buf->mgr->radeon, buf->bo)) { - return NULL; + 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; + } } + LIST_DELINIT(&buf->maplist); return buf->bo->data; } diff --git a/src/gallium/winsys/r600/drm/radeon_ws_bo.c b/src/gallium/winsys/r600/drm/radeon_ws_bo.c index 8114526a14a..daaf2cbc51a 100644 --- a/src/gallium/winsys/r600/drm/radeon_ws_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_ws_bo.c @@ -72,17 +72,6 @@ void radeon_ws_bo_reference(struct radeon *radeon, struct radeon_ws_bo **dst, *dst = src; } -int radeon_ws_bo_wait(struct radeon *radeon, struct radeon_ws_bo *pb_bo) -{ - /* TODO */ - struct radeon_bo *bo; - bo = radeon_bo_pb_get_bo(pb_bo->pb); - if (!bo) - return 0; - radeon_bo_wait(radeon, bo); - return 0; -} - unsigned radeon_ws_bo_get_handle(struct radeon_ws_bo *pb_bo) { struct radeon_bo *bo; |