diff options
author | Marek Olšák <[email protected]> | 2016-12-27 19:53:59 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-05 18:43:24 +0100 |
commit | e16245b3393911d703b688adb3ebf161e0b9ba8a (patch) | |
tree | 69d0972715f956851e882c1b9cb621289b38c8ff /src/gallium/drivers/radeonsi | |
parent | cba9d59362130e1b44cd9cfc4f38ad3773111442 (diff) |
radeonsi: turn SDMA IBs into de-facto preambles of GFX IBs
Draw calls no longer flush SDMA IBs. r600_need_dma_space is
responsible for synchronizing execution between both IBs.
Initial buffer clears and fast clears will stay unflushed in the SDMA IB
(up to 64 MB) as long as the GFX IB isn't flushed either.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 87ba31659b0..57eaac9dadc 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -62,11 +62,13 @@ void si_need_cs_space(struct si_context *ctx) { struct radeon_winsys_cs *cs = ctx->b.gfx.cs; struct radeon_winsys_cs *ce_ib = ctx->ce_ib; - struct radeon_winsys_cs *dma = ctx->b.dma.cs; - /* Flush the DMA IB if it's not empty. */ - if (radeon_emitted(dma, 0)) - ctx->b.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL); + /* There is no need to flush the DMA IB here, because + * r600_need_dma_space always flushes the GFX IB if there is + * a conflict, which means any unflushed DMA commands automatically + * precede the GFX IB (= they had no dependency on the GFX IB when + * they were submitted). + */ /* 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 @@ -106,6 +108,16 @@ void si_context_gfx_flush(void *context, unsigned flags, if (r600_check_device_reset(&ctx->b)) return; + /* If the state tracker is flushing the GFX IB, r600_flush_from_st is + * responsible for flushing the DMA IB and merging the fences from both. + * This code is only needed when the driver flushes the GFX IB + * internally, and it never asks for a fence handle. + */ + if (radeon_emitted(ctx->b.dma.cs, 0)) { + assert(fence == NULL); /* internal flushes only */ + ctx->b.dma.flush(ctx, flags, NULL); + } + ctx->gfx_flush_in_progress = true; r600_preflush_suspend_features(&ctx->b); |