Lines Matching refs:fence

50 				       struct dma_fence *fence)  in drm_sched_fence_set_parent()  argument
57 smp_store_release(&s_fence->parent, dma_fence_get(fence)); in drm_sched_fence_set_parent()
60 dma_fence_set_deadline(fence, s_fence->deadline); in drm_sched_fence_set_parent()
63 void drm_sched_fence_scheduled(struct drm_sched_fence *fence, in drm_sched_fence_scheduled() argument
73 drm_sched_fence_set_parent(fence, parent); in drm_sched_fence_scheduled()
75 dma_fence_signal(&fence->scheduled); in drm_sched_fence_scheduled()
78 void drm_sched_fence_finished(struct drm_sched_fence *fence, int result) in drm_sched_fence_finished() argument
81 dma_fence_set_error(&fence->finished, result); in drm_sched_fence_finished()
82 dma_fence_signal(&fence->finished); in drm_sched_fence_finished()
85 static const char *drm_sched_fence_get_driver_name(struct dma_fence *fence) in drm_sched_fence_get_driver_name() argument
92 struct drm_sched_fence *fence = to_drm_sched_fence(f); in drm_sched_fence_get_timeline_name() local
93 return (const char *)fence->sched->name; in drm_sched_fence_get_timeline_name()
99 struct drm_sched_fence *fence = to_drm_sched_fence(f); in drm_sched_fence_free_rcu() local
101 if (!WARN_ON_ONCE(!fence)) in drm_sched_fence_free_rcu()
102 kmem_cache_free(sched_fence_slab, fence); in drm_sched_fence_free_rcu()
113 void drm_sched_fence_free(struct drm_sched_fence *fence) in drm_sched_fence_free() argument
116 if (!WARN_ON_ONCE(fence->sched)) in drm_sched_fence_free()
117 kmem_cache_free(sched_fence_slab, fence); in drm_sched_fence_free()
130 struct drm_sched_fence *fence = to_drm_sched_fence(f); in drm_sched_fence_release_scheduled() local
132 dma_fence_put(fence->parent); in drm_sched_fence_release_scheduled()
133 call_rcu(&fence->finished.rcu, drm_sched_fence_free_rcu); in drm_sched_fence_release_scheduled()
145 struct drm_sched_fence *fence = to_drm_sched_fence(f); in drm_sched_fence_release_finished() local
147 dma_fence_put(&fence->scheduled); in drm_sched_fence_release_finished()
153 struct drm_sched_fence *fence = to_drm_sched_fence(f); in drm_sched_fence_set_deadline_finished() local
157 spin_lock_irqsave(&fence->lock, flags); in drm_sched_fence_set_deadline_finished()
161 ktime_before(fence->deadline, deadline)) { in drm_sched_fence_set_deadline_finished()
162 spin_unlock_irqrestore(&fence->lock, flags); in drm_sched_fence_set_deadline_finished()
166 fence->deadline = deadline; in drm_sched_fence_set_deadline_finished()
169 spin_unlock_irqrestore(&fence->lock, flags); in drm_sched_fence_set_deadline_finished()
176 parent = smp_load_acquire(&fence->parent); in drm_sched_fence_set_deadline_finished()
209 struct drm_sched_fence *fence = NULL; in drm_sched_fence_alloc() local
211 fence = kmem_cache_zalloc(sched_fence_slab, GFP_KERNEL); in drm_sched_fence_alloc()
212 if (fence == NULL) in drm_sched_fence_alloc()
215 fence->owner = owner; in drm_sched_fence_alloc()
216 spin_lock_init(&fence->lock); in drm_sched_fence_alloc()
218 return fence; in drm_sched_fence_alloc()
221 void drm_sched_fence_init(struct drm_sched_fence *fence, in drm_sched_fence_init() argument
226 fence->sched = entity->rq->sched; in drm_sched_fence_init()
228 dma_fence_init(&fence->scheduled, &drm_sched_fence_ops_scheduled, in drm_sched_fence_init()
229 &fence->lock, entity->fence_context, seq); in drm_sched_fence_init()
230 dma_fence_init(&fence->finished, &drm_sched_fence_ops_finished, in drm_sched_fence_init()
231 &fence->lock, entity->fence_context + 1, seq); in drm_sched_fence_init()