mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 06:10:23 +01:00
lavapipe: fix usleep usage in lvp_device
Acked-by: Jose Fonseca <jfonsec@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>
This commit is contained in:
parent
d399c3e861
commit
72ce22f991
2 changed files with 4 additions and 3 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "util/u_thread.h"
|
||||
#include "util/u_atomic.h"
|
||||
#include "util/timespec.h"
|
||||
#include "os_time.h"
|
||||
|
||||
static VkResult
|
||||
lvp_physical_device_init(struct lvp_physical_device *device,
|
||||
|
|
@ -1026,14 +1027,14 @@ static VkResult queue_wait_idle(struct lvp_queue *queue, uint64_t timeout)
|
|||
return p_atomic_read(&queue->count) == 0 ? VK_SUCCESS : VK_TIMEOUT;
|
||||
if (timeout == UINT64_MAX)
|
||||
while (p_atomic_read(&queue->count))
|
||||
usleep(100);
|
||||
os_time_sleep(100);
|
||||
else {
|
||||
struct timespec t, current;
|
||||
clock_gettime(CLOCK_MONOTONIC, ¤t);
|
||||
timespec_add_nsec(&t, ¤t, timeout);
|
||||
bool timedout = false;
|
||||
while (p_atomic_read(&queue->count) && !(timedout = timespec_passed(CLOCK_MONOTONIC, &t)))
|
||||
usleep(10);
|
||||
os_time_sleep(10);
|
||||
if (timedout)
|
||||
return VK_TIMEOUT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ timespec_after(const struct timespec *a, const struct timespec *b)
|
|||
(a->tv_sec > b->tv_sec);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifndef _MSC_VER
|
||||
/**
|
||||
* Checks whether a timespec value is after the current time
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue