Lines Matching refs:fence

99 do_futex_fence_wait(struct util_queue_fence *fence,  in do_futex_fence_wait()  argument
102 uint32_t v = fence->val; in do_futex_fence_wait()
109 v = p_atomic_cmpxchg(&fence->val, 1, 2); in do_futex_fence_wait()
114 int r = futex_wait(&fence->val, 2, timeout ? &ts : NULL); in do_futex_fence_wait()
120 v = fence->val; in do_futex_fence_wait()
127 _util_queue_fence_wait(struct util_queue_fence *fence) in _util_queue_fence_wait() argument
129 do_futex_fence_wait(fence, false, 0); in _util_queue_fence_wait()
133 _util_queue_fence_wait_timeout(struct util_queue_fence *fence, in _util_queue_fence_wait_timeout() argument
136 return do_futex_fence_wait(fence, true, abs_timeout); in _util_queue_fence_wait_timeout()
143 util_queue_fence_signal(struct util_queue_fence *fence) in util_queue_fence_signal() argument
145 mtx_lock(&fence->mutex); in util_queue_fence_signal()
146 fence->signalled = true; in util_queue_fence_signal()
147 cnd_broadcast(&fence->cond); in util_queue_fence_signal()
148 mtx_unlock(&fence->mutex); in util_queue_fence_signal()
152 _util_queue_fence_wait(struct util_queue_fence *fence) in _util_queue_fence_wait() argument
154 mtx_lock(&fence->mutex); in _util_queue_fence_wait()
155 while (!fence->signalled) in _util_queue_fence_wait()
156 cnd_wait(&fence->cond, &fence->mutex); in _util_queue_fence_wait()
157 mtx_unlock(&fence->mutex); in _util_queue_fence_wait()
161 _util_queue_fence_wait_timeout(struct util_queue_fence *fence, in _util_queue_fence_wait_timeout() argument
182 mtx_lock(&fence->mutex); in _util_queue_fence_wait_timeout()
183 while (!fence->signalled) { in _util_queue_fence_wait_timeout()
184 if (cnd_timedwait(&fence->cond, &fence->mutex, &ts) != thrd_success) in _util_queue_fence_wait_timeout()
187 mtx_unlock(&fence->mutex); in _util_queue_fence_wait_timeout()
190 return fence->signalled; in _util_queue_fence_wait_timeout()
194 util_queue_fence_init(struct util_queue_fence *fence) in util_queue_fence_init() argument
196 memset(fence, 0, sizeof(*fence)); in util_queue_fence_init()
197 (void) mtx_init(&fence->mutex, mtx_plain); in util_queue_fence_init()
198 cnd_init(&fence->cond); in util_queue_fence_init()
199 fence->signalled = true; in util_queue_fence_init()
203 util_queue_fence_destroy(struct util_queue_fence *fence) in util_queue_fence_destroy() argument
205 assert(fence->signalled); in util_queue_fence_destroy()
216 mtx_lock(&fence->mutex); in util_queue_fence_destroy()
217 mtx_unlock(&fence->mutex); in util_queue_fence_destroy()
219 cnd_destroy(&fence->cond); in util_queue_fence_destroy()
220 mtx_destroy(&fence->mutex); in util_queue_fence_destroy()
272 util_queue_fence_signal(job.fence); in util_queue_thread_func()
283 util_queue_fence_signal(queue->jobs[i].fence); in util_queue_thread_func()
411 struct util_queue_fence *fence, in util_queue_add_job() argument
426 util_queue_fence_reset(fence); in util_queue_add_job()
467 ptr->fence = fence; in util_queue_add_job()
488 util_queue_drop_job(struct util_queue *queue, struct util_queue_fence *fence) in util_queue_drop_job() argument
492 if (util_queue_fence_is_signalled(fence)) in util_queue_drop_job()
498 if (queue->jobs[i].fence == fence) { in util_queue_drop_job()
511 util_queue_fence_signal(fence); in util_queue_drop_job()
513 util_queue_fence_wait(fence); in util_queue_drop_job()