lavapipe: use os_time for timing related things

drop the use of the Linux code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
This commit is contained in:
Dave Airlie 2021-02-17 17:19:16 -08:00 committed by Marge Bot
parent 368c804383
commit 44f76d5fc7
2 changed files with 3 additions and 8 deletions

View file

@ -997,13 +997,8 @@ static VkResult queue_wait_idle(struct lvp_queue *queue, uint64_t timeout)
while (p_atomic_read(&queue->count))
os_time_sleep(100);
else {
struct timespec t, current;
clock_gettime(CLOCK_MONOTONIC, &current);
timespec_add_nsec(&t, &current, timeout);
bool timedout = false;
while (p_atomic_read(&queue->count) && !(timedout = timespec_passed(CLOCK_MONOTONIC, &t)))
os_time_sleep(10);
if (timedout)
int64_t atime = os_time_get_absolute_timeout(timeout);
if (!os_wait_until_zero_abs_timeout(&queue->count, atime))
return VK_TIMEOUT;
}
return VK_SUCCESS;

View file

@ -244,7 +244,7 @@ struct lvp_queue {
mtx_t m;
cnd_t new_work;
struct list_head workqueue;
uint32_t count;
volatile int count;
};
struct lvp_queue_work {