Lines Matching refs:fctx

27 	struct msm_fence_context *fctx;  in msm_fence_context_alloc()  local
29 fctx = kzalloc(sizeof(*fctx), GFP_KERNEL); in msm_fence_context_alloc()
30 if (!fctx) in msm_fence_context_alloc()
33 fctx->dev = dev; in msm_fence_context_alloc()
34 strncpy(fctx->name, name, sizeof(fctx->name)); in msm_fence_context_alloc()
35 fctx->context = dma_fence_context_alloc(1); in msm_fence_context_alloc()
36 init_waitqueue_head(&fctx->event); in msm_fence_context_alloc()
37 spin_lock_init(&fctx->spinlock); in msm_fence_context_alloc()
39 return fctx; in msm_fence_context_alloc()
42 void msm_fence_context_free(struct msm_fence_context *fctx) in msm_fence_context_free() argument
44 kfree(fctx); in msm_fence_context_free()
47 static inline bool fence_completed(struct msm_fence_context *fctx, uint32_t fence) in fence_completed() argument
49 return (int32_t)(fctx->completed_fence - fence) >= 0; in fence_completed()
53 int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, in msm_wait_fence() argument
58 if (fence > fctx->last_fence) { in msm_wait_fence()
60 fctx->name, fence, fctx->last_fence); in msm_wait_fence()
66 ret = fence_completed(fctx, fence) ? 0 : -EBUSY; in msm_wait_fence()
71 ret = wait_event_interruptible_timeout(fctx->event, in msm_wait_fence()
72 fence_completed(fctx, fence), in msm_wait_fence()
75 ret = wait_event_timeout(fctx->event, in msm_wait_fence()
76 fence_completed(fctx, fence), in msm_wait_fence()
81 fence, fctx->completed_fence); in msm_wait_fence()
92 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) in msm_update_fence() argument
94 spin_lock(&fctx->spinlock); in msm_update_fence()
95 fctx->completed_fence = max(fence, fctx->completed_fence); in msm_update_fence()
96 spin_unlock(&fctx->spinlock); in msm_update_fence()
98 wake_up_all(&fctx->event); in msm_update_fence()
103 struct msm_fence_context *fctx; member
119 return f->fctx->name; in msm_fence_get_timeline_name()
130 return fence_completed(f->fctx, f->base.seqno); in msm_fence_signaled()
143 msm_fence_alloc(struct msm_fence_context *fctx) in msm_fence_alloc() argument
151 f->fctx = fctx; in msm_fence_alloc()
153 dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock, in msm_fence_alloc()
154 fctx->context, ++fctx->last_fence); in msm_fence_alloc()