From 8b46d83637acf91528e31542fae27fda4fc5a94b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 4 Jan 2022 12:47:15 -0500 Subject: [PATCH] zink: add a better threshold for clamping query pool resets on suspend these pools should be dumped even if they aren't used Reviewed-by: Hoe Hao Cheng Part-of: --- src/gallium/drivers/zink/zink_query.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 636fbc2689d..231648d1fd7 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -849,7 +849,13 @@ zink_suspend_queries(struct zink_context *ctx, struct zink_batch *batch) } if (query->needs_update) update_qbo(ctx, query); - if (query->last_start && query->curr_query > NUM_QUERIES / 2) + /* do an implicit copy+reset if: + * - query is being read from and >50% of pool is used + * - >90% of pool is used + * + * this avoids overflow + */ + if ((query->last_start && query->curr_query > NUM_QUERIES / 2) || (query->curr_query > NUM_QUERIES * 0.9)) reset_pool(ctx, batch, query); } }