Mesa (main): zink: make timeline_wait use only a screen param
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed May 26 02:02:11 UTC 2021
Module: Mesa
Branch: main
Commit: 6766c983f0ed61006d722e7c4597c903b2dca8fe
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6766c983f0ed61006d722e7c4597c903b2dca8fe
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed May 12 11:06:11 2021 -0400
zink: make timeline_wait use only a screen param
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10882>
---
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);
More information about the mesa-commit
mailing list