Lines Matching +full:wait +full:- +full:free +full:- +full:us
4 * Permission is hereby granted, free of charge, to any person obtaining a
28 #include <linux/wait.h>
38 return -ENOMEM; in drm_sched_fence_slab_init()
53 * smp_store_release() to ensure another thread racing us in drm_sched_fence_set_parent()
57 smp_store_release(&s_fence->parent, dma_fence_get(fence)); in drm_sched_fence_set_parent()
59 &s_fence->finished.flags)) in drm_sched_fence_set_parent()
60 dma_fence_set_deadline(fence, s_fence->deadline); in drm_sched_fence_set_parent()
69 * to some firmware) doesn't have to busy wait for parent to show in drm_sched_fence_scheduled()
75 dma_fence_signal(&fence->scheduled); in drm_sched_fence_scheduled()
81 dma_fence_set_error(&fence->finished, result); in drm_sched_fence_finished()
82 dma_fence_signal(&fence->finished); in drm_sched_fence_finished()
93 return (const char *)fence->sched->name; in drm_sched_fence_get_timeline_name()
106 * drm_sched_fence_free - free up an uninitialized fence
108 * @fence: fence to free
110 * Free up the fence memory. Should only be used if drm_sched_fence_init()
116 if (!WARN_ON_ONCE(fence->sched)) in drm_sched_fence_free()
121 * drm_sched_fence_release_scheduled - callback that fence can be freed
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()
137 * drm_sched_fence_release_finished - drop extra reference
147 dma_fence_put(&fence->scheduled); in drm_sched_fence_release_finished()
157 spin_lock_irqsave(&fence->lock, flags); in drm_sched_fence_set_deadline_finished()
160 if (test_bit(DRM_SCHED_FENCE_FLAG_HAS_DEADLINE_BIT, &f->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()
167 set_bit(DRM_SCHED_FENCE_FLAG_HAS_DEADLINE_BIT, &f->flags); 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()
196 if (f->ops == &drm_sched_fence_ops_scheduled) in to_drm_sched_fence()
199 if (f->ops == &drm_sched_fence_ops_finished) in to_drm_sched_fence()
215 fence->owner = owner; in drm_sched_fence_alloc()
216 spin_lock_init(&fence->lock); in drm_sched_fence_alloc()
226 fence->sched = entity->rq->sched; in drm_sched_fence_init()
227 seq = atomic_inc_return(&entity->fence_seq); 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()