Lines Matching defs:fctx
57 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
59 if (!--fctx->notify_ref)
78 nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error)
83 spin_lock_irqsave(&fctx->lock, flags);
84 list_for_each_entry_safe(fence, tmp, &fctx->pending, head) {
89 nvif_event_block(&fctx->event);
91 fctx->killed = 1;
92 spin_unlock_irqrestore(&fctx->lock, flags);
96 nouveau_fence_context_del(struct nouveau_fence_chan *fctx)
98 cancel_work_sync(&fctx->uevent_work);
99 nouveau_fence_context_kill(fctx, 0);
100 nvif_event_dtor(&fctx->event);
101 fctx->dead = 1;
117 nouveau_fence_context_free(struct nouveau_fence_chan *fctx)
119 kref_put(&fctx->fence_ref, nouveau_fence_context_put);
123 nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx)
127 u32 seq = fctx->read(chan);
129 list_for_each_entry_safe(fence, tmp, &fctx->pending, head) {
138 nvif_event_block(&fctx->event);
144 struct nouveau_fence_chan *fctx = container_of(work, struct nouveau_fence_chan,
150 spin_lock_irqsave(&fctx->lock, flags);
151 fence = list_first_entry_or_null(&fctx->pending, typeof(*fence), head);
153 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock));
154 nouveau_fence_update(chan, fctx);
156 spin_unlock_irqrestore(&fctx->lock, flags);
162 struct nouveau_fence_chan *fctx = container_of(event, typeof(*fctx), event);
163 schedule_work(&fctx->uevent_work);
168 nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx)
179 INIT_WORK(&fctx->uevent_work, nouveau_fence_uevent_work);
180 INIT_LIST_HEAD(&fctx->flip);
181 INIT_LIST_HEAD(&fctx->pending);
182 spin_lock_init(&fctx->lock);
183 fctx->context = drm->runl[chan->runlist].context_base + chan->chid;
186 strcpy(fctx->name, "copy engine channel");
188 strcpy(fctx->name, "generic kernel channel");
190 strcpy(fctx->name, cli->name);
192 kref_init(&fctx->fence_ref);
201 args, __struct_size(args), &fctx->event);
210 struct nouveau_fence_chan *fctx = chan->fence;
218 &fctx->lock, fctx->context, ++fctx->sequence);
221 &fctx->lock, fctx->context, ++fctx->sequence);
222 kref_get(&fctx->fence_ref);
224 ret = fctx->emit(fence);
227 spin_lock_irq(&fctx->lock);
229 if (unlikely(fctx->killed)) {
230 spin_unlock_irq(&fctx->lock);
235 nouveau_fence_update(chan, fctx);
236 list_add_tail(&fence->head, &fctx->pending);
237 spin_unlock_irq(&fctx->lock);
246 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
249 spin_lock_irqsave(&fctx->lock, flags);
253 nvif_event_block(&fctx->event);
255 spin_unlock_irqrestore(&fctx->lock, flags);
261 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
268 spin_lock_irqsave(&fctx->lock, flags);
269 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock));
271 nouveau_fence_update(chan, fctx);
272 spin_unlock_irqrestore(&fctx->lock, flags);
358 struct nouveau_fence_chan *fctx = chan->fence;
393 fctx->sync(f, prev, chan) == 0))
461 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
463 return !fctx->dead ? fctx->name : "dead channel";
475 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
482 ret = (int)(fctx->read(chan) - fence->base.seqno) >= 0;
516 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
518 kref_put(&fctx->fence_ref, nouveau_fence_context_put);
534 struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
537 if (!fctx->notify_ref++)
538 nvif_event_allow(&fctx->event);
543 else if (!--fctx->notify_ref)
544 nvif_event_block(&fctx->event);