Mesa (master): zink: stall when we start getting a lot of uncompleted batches

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 29 01:47:32 UTC 2021


Module: Mesa
Branch: master
Commit: 34a2f96f59d7b73c0e5769000a2b6752a0df7c8c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34a2f96f59d7b73c0e5769000a2b6752a0df7c8c

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Nov 27 09:37:24 2020 -0500

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 <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>

---

 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);
    }



More information about the mesa-commit mailing list