From 34a2f96f59d7b73c0e5769000a2b6752a0df7c8c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 27 Nov 2020 09:37:24 -0500 Subject: [PATCH] zink: stall when we start getting a lot of uncompleted batches temporary oom handling, though it's unrealistic for this to be hit Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index ae28ace88ea..317b9b1ef10 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1824,7 +1824,7 @@ zink_maybe_flush_or_stall(struct zink_context *ctx) if (ctx->batch.state->resource_size >= screen->total_mem / 10) flush_batch(ctx); - if (ctx->resource_size >= screen->total_mem / 10) { + if (ctx->resource_size >= screen->total_mem / 10 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) { zink_fence_finish(zink_screen(ctx->base.screen), &ctx->base, ctx->last_fence, PIPE_TIMEOUT_INFINITE); zink_batch_reset_all(ctx); }