From 2728e5f2ccd52ca7ae93313025ae49298ac08df8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 21 Feb 2024 11:02:26 -0500 Subject: [PATCH] zink: only scan active batch states for free states if > 1 exist trying to recycle the current active batch state is never going to be productive cc: mesa-stable Part-of: (cherry picked from commit 16103b61e7dae3ac426fcc523a1a9b18a3c71e8e) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_batch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index aed3d5e27f6..34c19777f17 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -324,7 +324,7 @@ "description": "zink: only scan active batch states for free states if > 1 exist", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index 769ba4f212c..0da8db47713 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -458,8 +458,8 @@ get_batch_state(struct zink_context *ctx, struct zink_batch *batch) } simple_mtx_unlock(&screen->free_batch_states_lock); } - if (!bs && ctx->batch_states) { - /* states are stored sequentially, so if the first one doesn't work, none of them will */ + /* states are stored sequentially, so if the first one doesn't work, none of them will */ + if (!bs && ctx->batch_states && ctx->batch_states->next) { if (zink_screen_check_last_finished(screen, ctx->batch_states->fence.batch_id) || find_unused_state(ctx->batch_states)) { bs = ctx->batch_states;