mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 06:00:10 +01:00
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:
parent
368c804383
commit
44f76d5fc7
2 changed files with 3 additions and 8 deletions
|
|
@ -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, ¤t);
|
||||
timespec_add_nsec(&t, ¤t, 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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue