summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_hw_context.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-11-07 13:31:03 +0100
committerMarek Olšák <marek.olsak@amd.com>2015-11-13 19:54:41 +0100
commit81d412e02ce7db644774202b175f1f24b1f262c7 (patch)
tree6842c5b03a88f0d7abbd5a939e80b169584df57c /src/gallium/drivers/radeonsi/si_hw_context.c
parentc6012a6650c894e57dba51f8e336f134aad13d61 (diff)
downloadexternal_mesa3d-81d412e02ce7db644774202b175f1f24b1f262c7.zip
external_mesa3d-81d412e02ce7db644774202b175f1f24b1f262c7.tar.gz
external_mesa3d-81d412e02ce7db644774202b175f1f24b1f262c7.tar.bz2
gallium/radeon: move GFX/DMA flushing from add_to_buffer_list to need_cs_space
need_cs_space isn't invoked so often and is called before all commands too. This is a lot cleaner. The code in radeon_add_to_buffer_list always seemed dodgy to me. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_hw_context.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_hw_context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index 9b8bdf5..7d0e6d4 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -30,6 +30,11 @@
void si_need_cs_space(struct si_context *ctx)
{
struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
+ struct radeon_winsys_cs *dma = ctx->b.rings.dma.cs;
+
+ /* Flush the DMA IB if it's not empty. */
+ if (dma && dma->cdw)
+ ctx->b.rings.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
/* There are two memory usage counters in the winsys for all buffers
* that have been added (cs_add_buffer) and two counters in the pipe