Lines Matching full:fence

45 	struct xe_hw_fence *fence =
48 if (!WARN_ON_ONCE(!fence))
49 kmem_cache_free(xe_hw_fence_slab, fence);
55 struct xe_hw_fence *fence, *next;
61 list_for_each_entry_safe(fence, next, &irq->pending, irq_link) {
62 struct dma_fence *dma_fence = &fence->dma;
64 trace_xe_hw_fence_try_signal(fence);
66 trace_xe_hw_fence_signal(fence);
67 list_del_init(&fence->irq_link);
86 struct xe_hw_fence *fence, *next;
94 list_for_each_entry_safe(fence, next, &irq->pending, irq_link) {
95 list_del_init(&fence->irq_link);
96 err = dma_fence_signal_locked(&fence->dma);
97 dma_fence_put(&fence->dma);
143 static struct xe_hw_fence *to_xe_hw_fence(struct dma_fence *fence);
145 static struct xe_hw_fence_irq *xe_hw_fence_irq(struct xe_hw_fence *fence)
147 return container_of(fence->dma.lock, struct xe_hw_fence_irq, lock);
152 struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
154 return dev_name(fence->xe->drm.dev);
159 struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
161 return fence->name;
166 struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
167 struct xe_device *xe = fence->xe;
168 u32 seqno = xe_map_rd(xe, &fence->seqno_map, 0, u32);
176 struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
177 struct xe_hw_fence_irq *irq = xe_hw_fence_irq(fence);
180 list_add_tail(&fence->irq_link, &irq->pending);
182 /* SW completed (no HW IRQ) so kick handler to signal fence */
191 struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
193 XE_WARN_ON(!list_empty(&fence->irq_link));
205 static struct xe_hw_fence *to_xe_hw_fence(struct dma_fence *fence)
207 if (XE_WARN_ON(fence->ops != &xe_hw_fence_ops))
210 return container_of(fence, struct xe_hw_fence, dma);
214 * xe_hw_fence_alloc() - Allocate an hw fence.
216 * Allocate but don't initialize an hw fence.
218 * Return: Pointer to the allocated fence or
232 * xe_hw_fence_free() - Free an hw fence.
233 * @fence: Pointer to the fence to free.
235 * Frees an hw fence that hasn't yet been
238 void xe_hw_fence_free(struct dma_fence *fence)
240 fence_free(&fence->rcu);
244 * xe_hw_fence_init() - Initialize an hw fence.
245 * @fence: Pointer to the fence to initialize.
246 * @ctx: Pointer to the struct xe_hw_fence_ctx fence context.
249 * Initializes a pre-allocated hw fence.
250 * After initialization, the fence is subject to normal
251 * dma-fence refcounting.
253 void xe_hw_fence_init(struct dma_fence *fence, struct xe_hw_fence_ctx *ctx,
257 container_of(fence, typeof(*hw_fence), dma);
264 dma_fence_init(fence, &xe_hw_fence_ops, &ctx->irq->lock,