Lines Matching defs:obj

100 	struct dma_resv obj;
107 dma_resv_init(&obj);
112 ret = dma_resv_lock(&obj, &ctx);
114 dma_resv_lock_slow(&obj, &ctx);
127 ww_mutex_unlock(&obj.lock);
140 * @obj: the reservation object
142 void dma_resv_init(struct dma_resv *obj)
144 ww_mutex_init(&obj->lock, &reservation_ww_class);
145 seqcount_ww_mutex_init(&obj->seq, &obj->lock);
147 RCU_INIT_POINTER(obj->fence, NULL);
148 RCU_INIT_POINTER(obj->fence_excl, NULL);
154 * @obj: the reservation object
156 void dma_resv_fini(struct dma_resv *obj)
165 excl = rcu_dereference_protected(obj->fence_excl, 1);
169 fobj = rcu_dereference_protected(obj->fence, 1);
171 ww_mutex_destroy(&obj->lock);
178 * @obj: reservation object
182 * be called with obj->lock held.
187 int dma_resv_reserve_shared(struct dma_resv *obj, unsigned int num_fences)
192 dma_resv_assert_held(obj);
194 old = dma_resv_get_list(obj);
220 dma_resv_held(obj));
236 rcu_assign_pointer(obj->fence, new);
246 dma_resv_held(obj));
257 * @obj: the reservation object
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)
271 dma_resv_assert_held(obj);
273 fobj = dma_resv_get_list(obj);
276 write_seqcount_begin(&obj->seq);
281 dma_resv_held(obj));
296 write_seqcount_end(&obj->seq);
303 * @obj: the reservation object
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)
310 struct dma_fence *old_fence = dma_resv_get_excl(obj);
314 dma_resv_assert_held(obj);
316 old = dma_resv_get_list(obj);
323 write_seqcount_begin(&obj->seq);
325 RCU_INIT_POINTER(obj->fence_excl, fence);
328 write_seqcount_end(&obj->seq);
333 dma_resv_held(obj)));
422 * @obj: the reservation object
432 int dma_resv_get_fences_rcu(struct dma_resv *obj,
450 seq = read_seqcount_begin(&obj->seq);
452 fence_excl = rcu_dereference(obj->fence_excl);
456 fobj = rcu_dereference(obj->fence);
492 if (i != shared_count || read_seqcount_retry(&obj->seq, seq)) {
523 * @obj: the reservation object
532 long dma_resv_wait_timeout_rcu(struct dma_resv *obj,
543 seq = read_seqcount_begin(&obj->seq);
547 fence = rcu_dereference(obj->fence_excl);
562 struct dma_resv_list *fobj = rcu_dereference(obj->fence);
589 if (read_seqcount_retry(&obj->seq, seq)) {
627 * @obj: the reservation object
634 bool dma_resv_test_signaled_rcu(struct dma_resv *obj, bool test_all)
643 seq = read_seqcount_begin(&obj->seq);
648 struct dma_resv_list *fobj = rcu_dereference(obj->fence);
663 if (read_seqcount_retry(&obj->seq, seq))
668 struct dma_fence *fence_excl = rcu_dereference(obj->fence_excl);
675 if (read_seqcount_retry(&obj->seq, seq))