summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-10-23 13:49:50 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2018-03-14 09:04:05 +0100
commit3c4a4a33e48184cb4d64c2dc5b5b9e5b38404668 (patch)
treea852efa41995b11a86f3070c3869b3685bf13fa6
parent2c70f9d82c5ca18587693427767bce86b2c5c100 (diff)
radeonsi: asynchronous flushes don't have to wait for the submit thread
-rw-r--r--src/gallium/drivers/radeonsi/si_fence.c14
1 files changed, 13 insertions, 1 deletions
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);