Lines Matching full:shared

44  * The reservation object provides a mechanism to manage shared and
47 * write operations) or N shared fences (read operations). The RCU
66 list = kmalloc(offsetof(typeof(*list), shared[shared_max]), GFP_KERNEL); in dma_resv_list_alloc()
70 list->shared_max = (ksize(list) - offsetof(typeof(*list), shared)) / in dma_resv_list_alloc()
71 sizeof(*list->shared); in dma_resv_list_alloc()
90 dma_fence_put(rcu_dereference_protected(list->shared[i], true)); in dma_resv_list_free()
176 * dma_resv_reserve_shared - Reserve space to add shared fences to
219 fence = rcu_dereference_protected(old->shared[i], in dma_resv_reserve_shared()
222 RCU_INIT_POINTER(new->shared[--k], fence); in dma_resv_reserve_shared()
224 RCU_INIT_POINTER(new->shared[j++], fence); in dma_resv_reserve_shared()
232 * active (unsignaled) shared fences. Individual fences and the in dma_resv_reserve_shared()
245 fence = rcu_dereference_protected(new->shared[i], in dma_resv_reserve_shared()
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
280 old = rcu_dereference_protected(fobj->shared[i], in dma_resv_add_shared_fence()
292 RCU_INIT_POINTER(fobj->shared[i], fence); in dma_resv_add_shared_fence()
304 * @fence: the shared fence to add
330 /* inplace update, no shared fences */ in dma_resv_add_excl_fence()
332 dma_fence_put(rcu_dereference_protected(old->shared[i], in dma_resv_add_excl_fence()
378 fence = rcu_dereference(src_list->shared[i]); in dma_resv_copy_fences()
394 rcu_assign_pointer(dst_list->shared[dst_list->shared_count++], fence); in dma_resv_copy_fences()
420 * dma_resv_get_fences_rcu - Get an object's shared and exclusive
424 * @pshared_count: the number of shared fences returned
425 * @pshared: the array of shared fence ptrs returned (array is krealloc'd to
430 * shared fences as well. Returns either zero or -ENOMEM.
437 struct dma_fence **shared = NULL; in dma_resv_get_fences_rcu() local
458 sz += sizeof(*shared) * fobj->shared_max; in dma_resv_get_fences_rcu()
461 sz += sizeof(*shared); in dma_resv_get_fences_rcu()
466 nshared = krealloc(shared, sz, in dma_resv_get_fences_rcu()
474 nshared = krealloc(shared, sz, GFP_KERNEL); in dma_resv_get_fences_rcu()
476 shared = nshared; in dma_resv_get_fences_rcu()
483 shared = nshared; in dma_resv_get_fences_rcu()
486 shared[i] = rcu_dereference(fobj->shared[i]); in dma_resv_get_fences_rcu()
487 if (!dma_fence_get_rcu(shared[i])) in dma_resv_get_fences_rcu()
494 dma_fence_put(shared[i]); in dma_resv_get_fences_rcu()
507 shared[shared_count++] = fence_excl; in dma_resv_get_fences_rcu()
510 kfree(shared); in dma_resv_get_fences_rcu()
511 shared = NULL; in dma_resv_get_fences_rcu()
515 *pshared = shared; in dma_resv_get_fences_rcu()
522 * shared and/or exclusive fences.
568 struct dma_fence *lfence = rcu_dereference(fobj->shared[i]); in dma_resv_wait_timeout_rcu()
654 struct dma_fence *fence = rcu_dereference(fobj->shared[i]); in dma_resv_test_signaled_rcu()