zink: add a second fence disambiguation case

this is the case where:
* a batch A is submitted
* a no-op flush occurs
* the frontend gets the fence from already-flushed batch A
* zink recycles batch A
* the frontend waits on fence A

fixes #10598

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27623>
This commit is contained in:
Mike Blumenkrantz 2024-02-14 16:44:11 -05:00 committed by Marge Bot
parent 6a688e65a0
commit fb2ae7736f

View file

@ -185,7 +185,12 @@ zink_fence_finish(struct zink_screen *screen, struct pipe_context *pctx, struct
if (submit_diff > 1)
return true;
if (fence->submitted && zink_screen_check_last_finished(screen, fence->batch_id))
/* - if fence is submitted, batch_id is nonzero and can be checked
* - if fence is not submitted here, it must be reset; batch_id will be 0 and submitted is false
* in either case, the fence has finished
*/
if ((fence->submitted && zink_screen_check_last_finished(screen, fence->batch_id)) ||
(!fence->submitted && submit_diff))
return true;
return fence_wait(screen, fence, timeout_ns);