zink: once there are many outstanding submits, check for timeline updates

this should ensure that there are never too many cmdbufs pending

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37068>
This commit is contained in:
Mike Blumenkrantz 2025-08-22 13:57:20 -04:00 committed by Marge Bot
parent 86d0fc7b38
commit a3630c865f

View file

@ -600,6 +600,9 @@ post_submit(void *data, void *gdata, int thread_index)
} else if (bs->ctx->batch_states_count > 5000) {
/* throttle in case something crazy is happening */
zink_screen_timeline_wait(screen, bs->fence.batch_id - 2500, OS_TIMEOUT_INFINITE);
} else if (screen->curr_batch - screen->last_finished > 5) {
/* try to avoid ooming by regularly checking for batch completion */
zink_screen_timeline_wait(screen, screen->last_finished + 1, 0);
}
}