Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
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,
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
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;
if (!map) {
return NULL;
}
- radeon_ws_bo_wait(radeon, bo);
return map + offset;
}
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;
/*
}
}
- 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;
}
*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;