From 34f0aef19bb2c1022a3e4f9f069538be28b8e7e6 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 1 Sep 2021 11:55:08 -0400 Subject: [PATCH] radv: just use UINT64_MAX when getting absolute timeout for that value this would otherwise result in (UINT64_MAX - gettime()), which can effectively be rounded to UINT64_MAX without a noticeable change Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 6bf2b80..77688d0 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -99,11 +99,15 @@ radv_get_current_time(void) static uint64_t radv_get_absolute_timeout(uint64_t timeout) { - uint64_t current_time = radv_get_current_time(); + if (timeout == UINT64_MAX) { + return timeout; + } else { + uint64_t current_time = radv_get_current_time(); - timeout = MIN2(UINT64_MAX - current_time, timeout); + timeout = MIN2(UINT64_MAX - current_time, timeout); - return current_time + timeout; + return current_time + timeout; + } } static int -- 2.7.4