Lines Matching refs:fctx

16 	struct msm_fence_context *fctx;  in msm_fence_context_alloc()  local
18 fctx = kzalloc(sizeof(*fctx), GFP_KERNEL); in msm_fence_context_alloc()
19 if (!fctx) in msm_fence_context_alloc()
22 fctx->dev = dev; in msm_fence_context_alloc()
23 strncpy(fctx->name, name, sizeof(fctx->name)); in msm_fence_context_alloc()
24 fctx->context = dma_fence_context_alloc(1); in msm_fence_context_alloc()
25 init_waitqueue_head(&fctx->event); in msm_fence_context_alloc()
26 spin_lock_init(&fctx->spinlock); in msm_fence_context_alloc()
28 return fctx; in msm_fence_context_alloc()
31 void msm_fence_context_free(struct msm_fence_context *fctx) in msm_fence_context_free() argument
33 kfree(fctx); in msm_fence_context_free()
36 static inline bool fence_completed(struct msm_fence_context *fctx, uint32_t fence) in fence_completed() argument
38 return (int32_t)(fctx->completed_fence - fence) >= 0; in fence_completed()
42 int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, in msm_wait_fence() argument
47 if (fence > fctx->last_fence) { in msm_wait_fence()
49 fctx->name, fence, fctx->last_fence); in msm_wait_fence()
55 ret = fence_completed(fctx, fence) ? 0 : -EBUSY; in msm_wait_fence()
60 ret = wait_event_interruptible_timeout(fctx->event, in msm_wait_fence()
61 fence_completed(fctx, fence), in msm_wait_fence()
64 ret = wait_event_timeout(fctx->event, in msm_wait_fence()
65 fence_completed(fctx, fence), in msm_wait_fence()
70 fence, fctx->completed_fence); in msm_wait_fence()
81 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) in msm_update_fence() argument
83 spin_lock(&fctx->spinlock); in msm_update_fence()
84 fctx->completed_fence = max(fence, fctx->completed_fence); in msm_update_fence()
85 spin_unlock(&fctx->spinlock); in msm_update_fence()
87 wake_up_all(&fctx->event); in msm_update_fence()
92 struct msm_fence_context *fctx; member
108 return f->fctx->name; in msm_fence_get_timeline_name()
114 return fence_completed(f->fctx, f->base.seqno); in msm_fence_signaled()
124 msm_fence_alloc(struct msm_fence_context *fctx) in msm_fence_alloc() argument
132 f->fctx = fctx; in msm_fence_alloc()
134 dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock, in msm_fence_alloc()
135 fctx->context, ++fctx->last_fence); in msm_fence_alloc()