From 3c4a4a33e48184cb4d64c2dc5b5b9e5b38404668 Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Mon, 23 Oct 2017 13:49:50 +0200 Subject: radeonsi: asynchronous flushes don't have to wait for the submit thread --- src/gallium/drivers/radeonsi/si_fence.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_fence.c b/src/gallium/drivers/radeonsi/si_fence.c index 0f15df4807..84f659c1c8 100644 --- a/src/gallium/drivers/radeonsi/si_fence.c +++ b/src/gallium/drivers/radeonsi/si_fence.c @@ -457,7 +457,19 @@ static void si_flush_from_st(struct pipe_context *ctx, } assert(!fine.buf); finish: - if (!(flags & PIPE_FLUSH_DEFERRED)) { + /* Async flushes don't need to wait for CS submit thread to complete: + * they only require ordering of commands within a single context, + * which is guaranteed (the winsys never re-orders submits). + * + * Furthermore, even non-async flushes do not need to wait for the CS + * submit thread, as long as only in-process synchronization is + * required and all cross-process synchronization happens via explicit + * fences. + * + * However, some users of non-async flushes still rely on implicit + * fences being added to BOs. + */ + if (!(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC))) { if (rctx->dma.cs) ws->cs_sync_flush(rctx->dma.cs); ws->cs_sync_flush(rctx->gfx.cs); -- cgit v1.2.3