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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27729>
(cherry picked from commit 16103b61e7dae3ac426fcc523a1a9b18a3c71e8e)
This commit is contained in:
Mike Blumenkrantz 2024-02-21 11:02:26 -05:00 committed by Eric Engestrom
parent 313a9e6b73
commit 2728e5f2cc
2 changed files with 3 additions and 3 deletions

View file

@ -324,7 +324,7 @@
"description": "zink: only scan active batch states for free states if > 1 exist", "description": "zink: only scan active batch states for free states if > 1 exist",
"nominated": true, "nominated": true,
"nomination_type": 0, "nomination_type": 0,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null

View file

@ -458,8 +458,8 @@ get_batch_state(struct zink_context *ctx, struct zink_batch *batch)
} }
simple_mtx_unlock(&screen->free_batch_states_lock); 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) || if (zink_screen_check_last_finished(screen, ctx->batch_states->fence.batch_id) ||
find_unused_state(ctx->batch_states)) { find_unused_state(ctx->batch_states)) {
bs = ctx->batch_states; bs = ctx->batch_states;