Lines Matching refs:fctx
65 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_signal() local
67 if (!--fctx->notify_ref) in nouveau_fence_signal()
90 nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error) in nouveau_fence_context_kill() argument
94 spin_lock_irq(&fctx->lock); in nouveau_fence_context_kill()
95 while (!list_empty(&fctx->pending)) { in nouveau_fence_context_kill()
96 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_context_kill()
102 nvif_notify_put(&fctx->notify); in nouveau_fence_context_kill()
104 spin_unlock_irq(&fctx->lock); in nouveau_fence_context_kill()
108 nouveau_fence_context_del(struct nouveau_fence_chan *fctx) in nouveau_fence_context_del() argument
110 nouveau_fence_context_kill(fctx, 0); in nouveau_fence_context_del()
111 nvif_notify_dtor(&fctx->notify); in nouveau_fence_context_del()
112 fctx->dead = 1; in nouveau_fence_context_del()
128 nouveau_fence_context_free(struct nouveau_fence_chan *fctx) in nouveau_fence_context_free() argument
130 kref_put(&fctx->fence_ref, nouveau_fence_context_put); in nouveau_fence_context_free()
134 nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx) in nouveau_fence_update() argument
138 u32 seq = fctx->read(chan); in nouveau_fence_update()
140 while (!list_empty(&fctx->pending)) { in nouveau_fence_update()
141 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_update()
155 struct nouveau_fence_chan *fctx = in nouveau_fence_wait_uevent_handler() local
156 container_of(notify, typeof(*fctx), notify); in nouveau_fence_wait_uevent_handler()
160 spin_lock_irqsave(&fctx->lock, flags); in nouveau_fence_wait_uevent_handler()
161 if (!list_empty(&fctx->pending)) { in nouveau_fence_wait_uevent_handler()
165 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_wait_uevent_handler()
166 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); in nouveau_fence_wait_uevent_handler()
167 if (nouveau_fence_update(chan, fctx)) in nouveau_fence_wait_uevent_handler()
170 spin_unlock_irqrestore(&fctx->lock, flags); in nouveau_fence_wait_uevent_handler()
176 nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx) in nouveau_fence_context_new() argument
182 INIT_LIST_HEAD(&fctx->flip); in nouveau_fence_context_new()
183 INIT_LIST_HEAD(&fctx->pending); in nouveau_fence_context_new()
184 spin_lock_init(&fctx->lock); in nouveau_fence_context_new()
185 fctx->context = chan->drm->chan.context_base + chan->chid; in nouveau_fence_context_new()
188 strcpy(fctx->name, "copy engine channel"); in nouveau_fence_context_new()
190 strcpy(fctx->name, "generic kernel channel"); in nouveau_fence_context_new()
192 strcpy(fctx->name, nvxx_client(&cli->base)->name); in nouveau_fence_context_new()
194 kref_init(&fctx->fence_ref); in nouveau_fence_context_new()
204 &fctx->notify); in nouveau_fence_context_new()
212 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_emit() local
221 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
224 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
225 kref_get(&fctx->fence_ref); in nouveau_fence_emit()
228 ret = fctx->emit(fence); in nouveau_fence_emit()
231 spin_lock_irq(&fctx->lock); in nouveau_fence_emit()
233 if (nouveau_fence_update(chan, fctx)) in nouveau_fence_emit()
234 nvif_notify_put(&fctx->notify); in nouveau_fence_emit()
236 list_add_tail(&fence->head, &fctx->pending); in nouveau_fence_emit()
237 spin_unlock_irq(&fctx->lock); in nouveau_fence_emit()
248 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_done() local
255 spin_lock_irqsave(&fctx->lock, flags); in nouveau_fence_done()
256 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); in nouveau_fence_done()
257 if (chan && nouveau_fence_update(chan, fctx)) in nouveau_fence_done()
258 nvif_notify_put(&fctx->notify); in nouveau_fence_done()
259 spin_unlock_irqrestore(&fctx->lock, flags); in nouveau_fence_done()
344 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_sync() local
369 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
394 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
444 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_get_timeline_name() local
446 return !fctx->dead ? fctx->name : "dead channel"; in nouveau_fence_get_timeline_name()
458 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_is_signaled() local
465 ret = (int)(fctx->read(chan) - fence->base.seqno) >= 0; in nouveau_fence_is_signaled()
499 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_release() local
501 kref_put(&fctx->fence_ref, nouveau_fence_context_put); in nouveau_fence_release()
517 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_enable_signaling() local
520 if (!fctx->notify_ref++) in nouveau_fence_enable_signaling()
521 nvif_notify_get(&fctx->notify); in nouveau_fence_enable_signaling()
526 else if (!--fctx->notify_ref) in nouveau_fence_enable_signaling()
527 nvif_notify_put(&fctx->notify); in nouveau_fence_enable_signaling()