zink: handle expired deferred fences more reasonably
now that there's some tracking for the last-finished batch id, this can be used to detect when an application holds onto a sync object for way too long, to the point that the sync object has expired so far into the past that we no longer have any record of it existing fixes things like unigine superposition Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9963>
This commit is contained in:

committed by
Marge Bot

parent
a4e34f40a3
commit
2d38fb7e61
@@ -168,12 +168,17 @@ zink_fence_finish(struct zink_screen *screen, struct pipe_context *pctx, struct
|
||||
pctx = threaded_context_unwrap_sync(pctx);
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
|
||||
if (pctx && mfence->deferred_ctx == pctx && mfence->deferred_id == ctx->curr_batch) {
|
||||
zink_context(pctx)->batch.has_work = true;
|
||||
/* this must be the current batch */
|
||||
pctx->flush(pctx, NULL, !timeout_ns ? PIPE_FLUSH_ASYNC : 0);
|
||||
if (!timeout_ns)
|
||||
return false;
|
||||
if (pctx && mfence->deferred_ctx == pctx) {
|
||||
if (mfence->deferred_id == ctx->curr_batch) {
|
||||
zink_context(pctx)->batch.has_work = true;
|
||||
/* this must be the current batch */
|
||||
pctx->flush(pctx, NULL, !timeout_ns ? PIPE_FLUSH_ASYNC : 0);
|
||||
if (!timeout_ns)
|
||||
return false;
|
||||
}
|
||||
/* this batch is known to have finished */
|
||||
if (mfence->deferred_id <= screen->last_finished)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* need to ensure the tc mfence has been flushed before we wait */
|
||||
|
Reference in New Issue
Block a user