Lines Matching defs:fence
46 * can have attached one exclusive fence (normally associated with
56 * dma_resv_list_alloc - allocate fence list
77 * dma_resv_list_free - free fence list
147 RCU_INIT_POINTER(obj->fence, NULL);
169 fobj = rcu_dereference_protected(obj->fence, 1);
211 * no need to bump fence refcounts, rcu_read access
217 struct dma_fence *fence;
219 fence = rcu_dereference_protected(old->shared[i],
221 if (dma_fence_is_signaled(fence))
222 RCU_INIT_POINTER(new->shared[--k], fence);
224 RCU_INIT_POINTER(new->shared[j++], fence);
236 rcu_assign_pointer(obj->fence, new);
243 struct dma_fence *fence;
245 fence = rcu_dereference_protected(new->shared[i],
247 dma_fence_put(fence);
256 * dma_resv_add_shared_fence - Add a fence to a shared slot
258 * @fence: the shared fence to add
260 * Add a fence to a shared slot, obj->lock must be held, and
263 void dma_resv_add_shared_fence(struct dma_resv *obj, struct dma_fence *fence)
269 dma_fence_get(fence);
282 if (old->context == fence->context ||
292 RCU_INIT_POINTER(fobj->shared[i], fence);
302 * dma_resv_add_excl_fence - Add an exclusive fence.
304 * @fence: the shared fence to add
306 * Add a fence to the exclusive slot. The obj->lock must be held.
308 void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence)
320 if (fence)
321 dma_fence_get(fence);
325 RCU_INIT_POINTER(obj->fence_excl, fence);
355 src_list = rcu_dereference(src->fence);
368 src_list = rcu_dereference(src->fence);
376 struct dma_fence *fence;
378 fence = rcu_dereference(src_list->shared[i]);
380 &fence->flags))
383 if (!dma_fence_get_rcu(fence)) {
385 src_list = rcu_dereference(src->fence);
389 if (dma_fence_is_signaled(fence)) {
390 dma_fence_put(fence);
394 rcu_assign_pointer(dst_list->shared[dst_list->shared_count++], fence);
409 RCU_INIT_POINTER(dst->fence, dst_list);
423 * @pfence_excl: the returned exclusive fence (or NULL)
425 * @pshared: the array of shared fence ptrs returned (array is krealloc'd to
429 * exclusive fence is not specified the fence is put into the array of the
456 fobj = rcu_dereference(obj->fence);
524 * @wait_all: if true, wait on all fences, else wait on just exclusive fence
536 struct dma_fence *fence;
547 fence = rcu_dereference(obj->fence_excl);
548 if (fence && !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
549 if (!dma_fence_get_rcu(fence))
552 if (dma_fence_is_signaled(fence)) {
553 dma_fence_put(fence);
554 fence = NULL;
558 fence = NULL;
562 struct dma_resv_list *fobj = rcu_dereference(obj->fence);
567 for (i = 0; !fence && i < shared_count; ++i) {
582 fence = lfence;
588 if (fence) {
590 dma_fence_put(fence);
594 ret = dma_fence_wait_timeout(fence, intr, ret);
595 dma_fence_put(fence);
610 struct dma_fence *fence, *lfence = passed_fence;
614 fence = dma_fence_get_rcu(lfence);
615 if (!fence)
618 ret = !!dma_fence_is_signaled(fence);
619 dma_fence_put(fence);
629 * fence
648 struct dma_resv_list *fobj = rcu_dereference(obj->fence);
654 struct dma_fence *fence = rcu_dereference(fobj->shared[i]);
656 ret = dma_resv_test_signaled_single(fence);