diff options
| author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2025-08-06 14:01:41 -0400 |
|---|---|---|
| committer | Marge Bot <marge-bot@fdo.invalid> | 2025-08-07 16:00:54 +0000 |
| commit | d476a8c07b5ababa94b6f02cb4b0a71f0d6c5caf (patch) | |
| tree | c29502b82c99e5beab1df32f383b8aa17060abde | |
| parent | f5f7a5f8018bd1fe82cffbf00fb1b4cce11b5e78 (diff) | |
zink: stop always syncing threaded flushes
async flushes are meant to be async here, and the other ones are manually
synced later in the function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36643>
| -rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 2 | ||||
| -rw-r--r-- | src/gallium/drivers/zink/zink_fence.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 8a47f99e71e..ce07e65ee69 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -4078,7 +4078,7 @@ zink_flush(struct pipe_context *pctx, if (deferred && !(flags & PIPE_FLUSH_FENCE_FD) && pfence) deferred_fence = true; else - flush_batch(ctx, true); + flush_batch(ctx, false); } if (pfence) { diff --git a/src/gallium/drivers/zink/zink_fence.c b/src/gallium/drivers/zink/zink_fence.c index f28d335aecf..1c107a2182e 100644 --- a/src/gallium/drivers/zink/zink_fence.c +++ b/src/gallium/drivers/zink/zink_fence.c @@ -129,11 +129,18 @@ tc_fence_finish(struct zink_context *ctx, struct zink_tc_fence *mfence, uint64_t static bool fence_wait(struct zink_screen *screen, struct zink_fence *fence, uint64_t timeout_ns) { + struct zink_batch_state *bs = zink_batch_state(fence); if (screen->device_lost) return true; if (p_atomic_read(&fence->completed)) return true; + if (screen->threaded_submit) { + int64_t abs_timeout = os_time_get_absolute_timeout(timeout_ns); + if (!util_queue_fence_wait_timeout(&bs->flush_completed, abs_timeout)) + return false; + } + assert(fence->batch_id); assert(fence->submitted); @@ -141,7 +148,7 @@ fence_wait(struct zink_screen *screen, struct zink_fence *fence, uint64_t timeou if (success) { p_atomic_set(&fence->completed, true); - zink_batch_state(fence)->usage.usage = 0; + bs->usage.usage = 0; zink_screen_update_last_finished(screen, fence->batch_id); } return success; |