r600g: Buffer object maps imply a wait.
Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
This commit is contained in:
parent
de9c8015eb
commit
affd46cc2b
|
@ -92,26 +92,6 @@ enum radeon_family {
|
|||
|
||||
enum radeon_family r600_get_family(struct radeon *rw);
|
||||
|
||||
/*
|
||||
* radeon object functions
|
||||
*/
|
||||
#if 0
|
||||
struct radeon_bo {
|
||||
unsigned refcount;
|
||||
unsigned handle;
|
||||
unsigned size;
|
||||
unsigned alignment;
|
||||
unsigned map_count;
|
||||
void *data;
|
||||
};
|
||||
struct radeon_bo *radeon_bo(struct radeon *radeon, unsigned handle,
|
||||
unsigned size, unsigned alignment, void *ptr);
|
||||
int radeon_bo_map(struct radeon *radeon, struct radeon_bo *bo);
|
||||
void radeon_bo_unmap(struct radeon *radeon, struct radeon_bo *bo);
|
||||
struct radeon_bo *radeon_bo_incref(struct radeon *radeon, struct radeon_bo *bo);
|
||||
struct radeon_bo *radeon_bo_decref(struct radeon *radeon, struct radeon_bo *bo);
|
||||
int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo);
|
||||
#endif
|
||||
/* lowlevel WS bo */
|
||||
struct radeon_ws_bo;
|
||||
struct radeon_ws_bo *radeon_ws_bo(struct radeon *radeon,
|
||||
|
@ -122,7 +102,6 @@ void *radeon_ws_bo_map(struct radeon *radeon, struct radeon_ws_bo *bo, unsigned
|
|||
void radeon_ws_bo_unmap(struct radeon *radeon, struct radeon_ws_bo *bo);
|
||||
void radeon_ws_bo_reference(struct radeon *radeon, struct radeon_ws_bo **dst,
|
||||
struct radeon_ws_bo *src);
|
||||
int radeon_ws_bo_wait(struct radeon *radeon, struct radeon_ws_bo *bo);
|
||||
|
||||
/* R600/R700 STATES */
|
||||
#define R600_GROUP_MAX 16
|
||||
|
|
|
@ -108,7 +108,6 @@ static void r600_query_result(struct pipe_context *ctx, struct r600_query *rquer
|
|||
u32 *results;
|
||||
int i;
|
||||
|
||||
radeon_ws_bo_wait(rscreen->rw, rquery->buffer);
|
||||
results = radeon_ws_bo_map(rscreen->rw, rquery->buffer, 0, r600_context(ctx));
|
||||
for (i = 0; i < rquery->num_results; i += 4) {
|
||||
start = (u64)results[i] | (u64)results[i + 1] << 32;
|
||||
|
|
|
@ -347,7 +347,6 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
|
|||
if (!map) {
|
||||
return NULL;
|
||||
}
|
||||
radeon_ws_bo_wait(radeon, bo);
|
||||
|
||||
return map + offset;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ void *radeon_ws_bo_map(struct radeon *radeon, struct radeon_ws_bo *bo, unsigned
|
|||
void radeon_ws_bo_unmap(struct radeon *radeon, struct radeon_ws_bo *bo);
|
||||
void radeon_ws_bo_reference(struct radeon *radeon, struct radeon_ws_bo **dst,
|
||||
struct radeon_ws_bo *src);
|
||||
int radeon_ws_bo_wait(struct radeon *radeon, struct radeon_ws_bo *bo);
|
||||
|
||||
struct radeon_stype_info;
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue