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()
91 nouveau_fence_context_del(struct nouveau_fence_chan *fctx) in nouveau_fence_context_del() argument
95 spin_lock_irq(&fctx->lock); in nouveau_fence_context_del()
96 while (!list_empty(&fctx->pending)) { in nouveau_fence_context_del()
97 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_context_del()
100 nvif_notify_put(&fctx->notify); in nouveau_fence_context_del()
102 spin_unlock_irq(&fctx->lock); in nouveau_fence_context_del()
104 nvif_notify_fini(&fctx->notify); in nouveau_fence_context_del()
105 fctx->dead = 1; in nouveau_fence_context_del()
121 nouveau_fence_context_free(struct nouveau_fence_chan *fctx) in nouveau_fence_context_free() argument
123 kref_put(&fctx->fence_ref, nouveau_fence_context_put); in nouveau_fence_context_free()
127 nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx) in nouveau_fence_update() argument
131 u32 seq = fctx->read(chan); in nouveau_fence_update()
133 while (!list_empty(&fctx->pending)) { in nouveau_fence_update()
134 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_update()
148 struct nouveau_fence_chan *fctx = in nouveau_fence_wait_uevent_handler() local
149 container_of(notify, typeof(*fctx), notify); in nouveau_fence_wait_uevent_handler()
153 spin_lock_irqsave(&fctx->lock, flags); in nouveau_fence_wait_uevent_handler()
154 if (!list_empty(&fctx->pending)) { in nouveau_fence_wait_uevent_handler()
158 fence = list_entry(fctx->pending.next, typeof(*fence), head); in nouveau_fence_wait_uevent_handler()
159 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); in nouveau_fence_wait_uevent_handler()
160 if (nouveau_fence_update(chan, fctx)) in nouveau_fence_wait_uevent_handler()
163 spin_unlock_irqrestore(&fctx->lock, flags); in nouveau_fence_wait_uevent_handler()
169 nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chan *fctx) in nouveau_fence_context_new() argument
175 INIT_LIST_HEAD(&fctx->flip); in nouveau_fence_context_new()
176 INIT_LIST_HEAD(&fctx->pending); in nouveau_fence_context_new()
177 spin_lock_init(&fctx->lock); in nouveau_fence_context_new()
178 fctx->context = priv->context_base + chan->chid; in nouveau_fence_context_new()
181 strcpy(fctx->name, "copy engine channel"); in nouveau_fence_context_new()
183 strcpy(fctx->name, "generic kernel channel"); in nouveau_fence_context_new()
185 strcpy(fctx->name, nvxx_client(&cli->base)->name); in nouveau_fence_context_new()
187 kref_init(&fctx->fence_ref); in nouveau_fence_context_new()
196 &fctx->notify); in nouveau_fence_context_new()
260 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_emit() local
269 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
272 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
273 kref_get(&fctx->fence_ref); in nouveau_fence_emit()
276 ret = fctx->emit(fence); in nouveau_fence_emit()
279 spin_lock_irq(&fctx->lock); in nouveau_fence_emit()
281 if (nouveau_fence_update(chan, fctx)) in nouveau_fence_emit()
282 nvif_notify_put(&fctx->notify); in nouveau_fence_emit()
284 list_add_tail(&fence->head, &fctx->pending); in nouveau_fence_emit()
285 spin_unlock_irq(&fctx->lock); in nouveau_fence_emit()
296 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_done() local
303 spin_lock_irqsave(&fctx->lock, flags); in nouveau_fence_done()
304 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); in nouveau_fence_done()
305 if (chan && nouveau_fence_update(chan, fctx)) in nouveau_fence_done()
306 nvif_notify_put(&fctx->notify); in nouveau_fence_done()
307 spin_unlock_irqrestore(&fctx->lock, flags); in nouveau_fence_done()
392 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_sync() local
417 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
442 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
494 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_get_timeline_name() local
496 return !fctx->dead ? fctx->name : "dead channel"; in nouveau_fence_get_timeline_name()
508 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_is_signaled() local
515 ret = (int)(fctx->read(chan) - fence->base.seqno) >= 0; in nouveau_fence_is_signaled()
549 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_release() local
551 kref_put(&fctx->fence_ref, nouveau_fence_context_put); in nouveau_fence_release()
567 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_enable_signaling() local
570 if (!fctx->notify_ref++) in nouveau_fence_enable_signaling()
571 nvif_notify_get(&fctx->notify); in nouveau_fence_enable_signaling()
576 else if (!--fctx->notify_ref) in nouveau_fence_enable_signaling()
577 nvif_notify_put(&fctx->notify); in nouveau_fence_enable_signaling()