Lines Matching refs:fence
38 static const char *vgem_fence_get_driver_name(struct dma_fence *fence) in vgem_fence_get_driver_name() argument
43 static const char *vgem_fence_get_timeline_name(struct dma_fence *fence) in vgem_fence_get_timeline_name() argument
50 struct vgem_fence *fence = container_of(base, typeof(*fence), base); in vgem_fence_release() local
52 del_timer_sync(&fence->timer); in vgem_fence_release()
53 dma_fence_free(&fence->base); in vgem_fence_release()
56 static void vgem_fence_value_str(struct dma_fence *fence, char *str, int size) in vgem_fence_value_str() argument
58 snprintf(str, size, "%llu", fence->seqno); in vgem_fence_value_str()
61 static void vgem_fence_timeline_value_str(struct dma_fence *fence, char *str, in vgem_fence_timeline_value_str() argument
65 dma_fence_is_signaled(fence) ? fence->seqno : 0); in vgem_fence_timeline_value_str()
79 struct vgem_fence *fence = from_timer(fence, t, timer); in vgem_fence_timeout() local
81 dma_fence_signal(&fence->base); in vgem_fence_timeout()
87 struct vgem_fence *fence; in vgem_fence_create() local
89 fence = kzalloc(sizeof(*fence), GFP_KERNEL); in vgem_fence_create()
90 if (!fence) in vgem_fence_create()
93 spin_lock_init(&fence->lock); in vgem_fence_create()
94 dma_fence_init(&fence->base, &vgem_fence_ops, &fence->lock, in vgem_fence_create()
97 timer_setup(&fence->timer, vgem_fence_timeout, 0); in vgem_fence_create()
100 mod_timer(&fence->timer, jiffies + VGEM_FENCE_TIMEOUT); in vgem_fence_create()
102 return &fence->base; in vgem_fence_create()
134 struct dma_fence *fence; in vgem_fence_attach_ioctl() local
147 fence = vgem_fence_create(vfile, arg->flags); in vgem_fence_attach_ioctl()
148 if (!fence) { in vgem_fence_attach_ioctl()
165 dma_resv_add_fence(resv, fence, arg->flags & VGEM_FENCE_WRITE ? in vgem_fence_attach_ioctl()
172 ret = idr_alloc(&vfile->fence_idr, fence, 1, 0, GFP_KERNEL); in vgem_fence_attach_ioctl()
181 dma_fence_signal(fence); in vgem_fence_attach_ioctl()
182 dma_fence_put(fence); in vgem_fence_attach_ioctl()
211 struct dma_fence *fence; in vgem_fence_signal_ioctl() local
218 fence = idr_replace(&vfile->fence_idr, NULL, arg->fence); in vgem_fence_signal_ioctl()
220 if (!fence) in vgem_fence_signal_ioctl()
222 if (IS_ERR(fence)) in vgem_fence_signal_ioctl()
223 return PTR_ERR(fence); in vgem_fence_signal_ioctl()
225 if (dma_fence_is_signaled(fence)) in vgem_fence_signal_ioctl()
228 dma_fence_signal(fence); in vgem_fence_signal_ioctl()
229 dma_fence_put(fence); in vgem_fence_signal_ioctl()