From 66066650c968769669040e85beeff412ffedb7e0 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 9 Apr 2024 21:38:15 +0200 Subject: [PATCH] zink: if AcquireNextImageKHR fails with VK_NOT_READY or VK_TIMEOUT retry Gradually increase timeout until we reach a limit on which we abort. This fixes a crash with spec@ext_framebuffer_blit@fbo-blit-check-limits on llvmpipe. Fixes: d1cac5ed0566ed02f1a522cc690ab5cda1880ec0 zink: acquire - maybe clear timeout after waiting for presentation fence Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/zink/zink_kopper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index c6fee16d4b4..d508e2e06d7 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -574,6 +574,12 @@ kopper_acquire(struct zink_screen *screen, struct zink_resource *res, uint64_t t res->obj->new_dt = true; continue; } + if (ret == VK_NOT_READY || ret == VK_TIMEOUT) { + if (timeout > 1000000) + unreachable("kopper_acquire: updated timeout after failure has become unreasonable large"); + timeout += 4000; + continue; + } VKSCR(DestroySemaphore)(screen->dev, acquire, NULL); return ret; }