summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_pipe_common.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-04-28 18:06:55 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-05-10 17:20:09 +0200
commit2b58bc44615c2ac61a0ff35cc69c8aae2b501083 (patch)
treebf24a09a51b68fe8f24e0b61bf93044b2c6d411c /src/gallium/drivers/radeon/r600_pipe_common.c
parentfb89f066983eb3799bb05e2570dbbf66639f4818 (diff)
downloadexternal_mesa3d-2b58bc44615c2ac61a0ff35cc69c8aae2b501083.zip
external_mesa3d-2b58bc44615c2ac61a0ff35cc69c8aae2b501083.tar.gz
external_mesa3d-2b58bc44615c2ac61a0ff35cc69c8aae2b501083.tar.bz2
gallium/radeon: don't flush the GFX IB if DMA doesn't depend on it
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_pipe_common.c')
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 6cbc92b..a5966d9 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -154,8 +154,14 @@ void r600_need_dma_space(struct r600_common_context *ctx, unsigned num_dw,
gtt += src->buf->size;
}
- /* Flush the GFX IB if it's not empty. */
- if (ctx->gfx.cs->cdw > ctx->initial_gfx_cs_size)
+ /* Flush the GFX IB if DMA depends on it. */
+ if (ctx->gfx.cs->cdw > ctx->initial_gfx_cs_size &&
+ ((dst &&
+ ctx->ws->cs_is_buffer_referenced(ctx->gfx.cs, dst->buf,
+ RADEON_USAGE_READWRITE)) ||
+ (src &&
+ ctx->ws->cs_is_buffer_referenced(ctx->gfx.cs, src->buf,
+ RADEON_USAGE_WRITE))))
ctx->gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
/* Flush if there's not enough space, or if the memory usage per IB