summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-02-01 15:06:39 +0100
committerMarek Olšák <[email protected]>2014-02-04 20:19:16 +0100
commit07075cf350a57bb61e6c99c7abb769f02b9068a7 (patch)
treefb65911b541017018dc4f421d96fd77e9324e43c /src/gallium
parent08f0344cf395b7ceee20c4c4030946c9334895bc (diff)
r600g,radeonsi: skip unnecessary buffer_is_busy call, add a comment
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeon/r600_buffer_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 5b9282539e9..20772289e24 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -49,6 +49,7 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx,
unsigned usage)
{
enum radeon_bo_usage rusage = RADEON_USAGE_READWRITE;
+ bool busy = false;
if (usage & PIPE_TRANSFER_UNSYNCHRONIZED) {
return ctx->ws->buffer_map(resource->cs_buf, NULL, usage);
@@ -67,6 +68,7 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx,
return NULL;
} else {
ctx->rings.gfx.flush(ctx, 0);
+ busy = true;
}
}
if (ctx->rings.dma.cs &&
@@ -78,10 +80,11 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx,
return NULL;
} else {
ctx->rings.dma.flush(ctx, 0);
+ busy = true;
}
}
- if (ctx->ws->buffer_is_busy(resource->buf, rusage)) {
+ if (busy || ctx->ws->buffer_is_busy(resource->buf, rusage)) {
if (usage & PIPE_TRANSFER_DONTBLOCK) {
return NULL;
} else {
@@ -93,6 +96,7 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx,
}
}
+ /* Setting the CS to NULL will prevent doing checks we have done already. */
return ctx->ws->buffer_map(resource->cs_buf, NULL, usage);
}