summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-03-28 23:34:28 -0400
committerMarge Bot <eric+marge@anholt.net>2021-03-30 15:12:58 +0000
commitf9ee9c4539d93f9aeb564cf54f23074f60338d9c (patch)
treef668d78b5a1fee2e011815a2bfb95c86c4ab2274
parent03946bfcdd881b62eff254a68a08a7a35d79f6cd (diff)
zink: assume fence has already completed if a batch state isn't found
we're not going to be waiting on fences from the future, so if we can't find a fence then it must have completed Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
-rw-r--r--src/gallium/drivers/zink/zink_context.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 01315d10023..33b7c0ff521 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1940,18 +1940,9 @@ zink_wait_on_batch(struct zink_context *ctx, uint32_t batch_id)
else {
struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&ctx->batch_states, batch_id, (void*)(uintptr_t)batch_id);
if (!he) {
- util_dynarray_foreach(&ctx->free_batch_states, struct zink_batch_state*, bs) {
- if ((*bs)->fence.batch_id == batch_id) {
- simple_mtx_unlock(&ctx->batch_mtx);
- return;
- }
- }
- if (ctx->last_fence && ctx->last_fence->batch_id > batch_id) {
- /* already completed */
- simple_mtx_unlock(&ctx->batch_mtx);
- return;
- }
- unreachable("should've found batch state");
+ /* batch has already completed */
+ simple_mtx_unlock(&ctx->batch_mtx);
+ return;
}
fence = he->data;
}