this would otherwise result in (UINT64_MAX - gettime()), which can effectively
be rounded to UINT64_MAX without a noticeable change
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12680>
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