From 6766c983f0ed61006d722e7c4597c903b2dca8fe Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 12 May 2021 11:06:11 -0400 Subject: [PATCH] zink: make timeline_wait use only a screen param Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 67106acd6b4..5e1466b9c11 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2240,9 +2240,8 @@ zink_fence_wait(struct pipe_context *pctx) } static bool -timeline_wait(struct zink_context *ctx, uint32_t batch_id, uint64_t timeout) +timeline_wait(struct zink_screen *screen, uint32_t batch_id, uint64_t timeout) { - struct zink_screen *screen = zink_screen(ctx->base.screen); VkSemaphoreWaitInfo wi = {}; wi.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO; wi.semaphoreCount = 1; @@ -2258,8 +2257,6 @@ timeline_wait(struct zink_context *ctx, uint32_t batch_id, uint64_t timeout) if (success) zink_screen_update_last_finished(screen, batch_id); - else - check_device_lost(ctx); return success; } @@ -2273,7 +2270,8 @@ zink_wait_on_batch(struct zink_context *ctx, uint32_t batch_id) /* not submitted yet */ flush_batch(ctx, true); if (ctx->have_timelines) { - timeline_wait(ctx, batch_id, UINT64_MAX); + if (!timeline_wait(zink_screen(ctx->base.screen), batch_id, UINT64_MAX)) + check_device_lost(ctx); return; } simple_mtx_lock(&ctx->batch_mtx); @@ -2315,8 +2313,12 @@ zink_check_batch_completion(struct zink_context *ctx, uint32_t batch_id) if (zink_screen_check_last_finished(zink_screen(ctx->base.screen), batch_id)) return true; - if (ctx->have_timelines) - return timeline_wait(ctx, batch_id, 0); + if (ctx->have_timelines) { + bool success = timeline_wait(zink_screen(ctx->base.screen), batch_id, 0); + if (!success) + check_device_lost(ctx); + return success; + } struct zink_fence *fence; simple_mtx_lock(&ctx->batch_mtx);