From 3db1ce01b1f33aaeceda4038487a4ce0ceb77267 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Mon, 13 Nov 2017 14:50:17 +0100 Subject: [PATCH] radeonsi: recompute the relative timeout after waiting for ready fence MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_fence.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_fence.c b/src/gallium/drivers/radeonsi/si_fence.c index fa80f4fd87a..ff1800ce785 100644 --- a/src/gallium/drivers/radeonsi/si_fence.c +++ b/src/gallium/drivers/radeonsi/si_fence.c @@ -216,6 +216,11 @@ static boolean si_fence_finish(struct pipe_screen *screen, if (!util_queue_fence_wait_timeout(&rfence->ready, abs_timeout)) return false; } + + if (timeout && timeout != PIPE_TIMEOUT_INFINITE) { + int64_t time = os_time_get_nano(); + timeout = abs_timeout > time ? abs_timeout - time : 0; + } } if (rfence->sdma) { -- 2.30.2