struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
struct pipe_context *pctx = ctx;
-//printf("%s:%d ************************************************\n", __func__, __LINE__);
if (flags & PB_USAGE_UNSYNCHRONIZED) {
if (!buf->bo->data && radeon_bo_map(buf->mgr->radeon, buf->bo)) {
return NULL;
return buf->bo->data;
}
- if (flags & PB_USAGE_DONTBLOCK) {
- return NULL;
- }
- if (ctx) {
- pctx->flush(pctx, 0, NULL);
+ if (p_atomic_read(&buf->bo->reference.count) > 1) {
+ if (flags & PB_USAGE_DONTBLOCK) {
+ return NULL;
+ }
+ if (ctx) {
+ pctx->flush(pctx, 0, NULL);
+ }
}
if (flags & PB_USAGE_DONTBLOCK) {