mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
zink: fix waiting on current batch id
- the current batch id is always 0
- there is always a current batch
- a batch id can only be set at the time of submit
thus when passing 0 to wait on the current batch, the submit must complete
so that there is a batch id, and this must occur before the timeline wait
path or else the timeline wait does nothing
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14693>
(cherry picked from commit 3a0888c62f)
This commit is contained in:
parent
494e809469
commit
c975c588b1
2 changed files with 10 additions and 6 deletions
|
|
@ -3433,7 +3433,7 @@
|
|||
"description": "zink: fix waiting on current batch id",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3094,11 +3094,15 @@ zink_fence_wait(struct pipe_context *pctx)
|
|||
void
|
||||
zink_wait_on_batch(struct zink_context *ctx, uint32_t batch_id)
|
||||
{
|
||||
struct zink_batch_state *bs = ctx->batch.state;
|
||||
assert(bs);
|
||||
if (!batch_id || bs->fence.batch_id == batch_id)
|
||||
struct zink_batch_state *bs;
|
||||
if (!batch_id) {
|
||||
/* not submitted yet */
|
||||
flush_batch(ctx, true);
|
||||
bs = zink_batch_state(ctx->last_fence);
|
||||
assert(bs);
|
||||
batch_id = bs->fence.batch_id;
|
||||
}
|
||||
assert(batch_id);
|
||||
if (ctx->have_timelines) {
|
||||
if (!zink_screen_timeline_wait(zink_screen(ctx->base.screen), batch_id, UINT64_MAX))
|
||||
check_device_lost(ctx);
|
||||
|
|
@ -3107,8 +3111,8 @@ zink_wait_on_batch(struct zink_context *ctx, uint32_t batch_id)
|
|||
simple_mtx_lock(&ctx->batch_mtx);
|
||||
struct zink_fence *fence;
|
||||
|
||||
assert(batch_id || ctx->last_fence);
|
||||
if (ctx->last_fence && (!batch_id || batch_id == zink_batch_state(ctx->last_fence)->fence.batch_id))
|
||||
assert(ctx->last_fence);
|
||||
if (batch_id == zink_batch_state(ctx->last_fence)->fence.batch_id)
|
||||
fence = ctx->last_fence;
|
||||
else {
|
||||
for (bs = ctx->batch_states; bs; bs = bs->next) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue