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(fence->channel, 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()
197 &fctx->notify); in nouveau_fence_context_new()
261 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_emit() local
270 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
273 &fctx->lock, fctx->context, ++fctx->sequence); in nouveau_fence_emit()
274 kref_get(&fctx->fence_ref); in nouveau_fence_emit()
277 ret = fctx->emit(fence); in nouveau_fence_emit()
280 spin_lock_irq(&fctx->lock); in nouveau_fence_emit()
282 if (nouveau_fence_update(chan, fctx)) in nouveau_fence_emit()
283 nvif_notify_put(&fctx->notify); in nouveau_fence_emit()
285 list_add_tail(&fence->head, &fctx->pending); in nouveau_fence_emit()
286 spin_unlock_irq(&fctx->lock); in nouveau_fence_emit()
297 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_done() local
304 spin_lock_irqsave(&fctx->lock, flags); in nouveau_fence_done()
305 chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); in nouveau_fence_done()
306 if (chan && nouveau_fence_update(chan, fctx)) in nouveau_fence_done()
307 nvif_notify_put(&fctx->notify); in nouveau_fence_done()
308 spin_unlock_irqrestore(&fctx->lock, flags); in nouveau_fence_done()
393 struct nouveau_fence_chan *fctx = chan->fence; in nouveau_fence_sync() local
418 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
443 if (prev && (prev == chan || fctx->sync(f, prev, chan) == 0)) in nouveau_fence_sync()
495 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_get_timeline_name() local
497 return !fctx->dead ? fctx->name : "dead channel"; in nouveau_fence_get_timeline_name()
509 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_is_signaled() local
516 ret = (int)(fctx->read(chan) - fence->base.seqno) >= 0; in nouveau_fence_is_signaled()
550 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_release() local
552 kref_put(&fctx->fence_ref, nouveau_fence_context_put); in nouveau_fence_release()
568 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_enable_signaling() local
571 if (!fctx->notify_ref++) in nouveau_fence_enable_signaling()
572 nvif_notify_get(&fctx->notify); in nouveau_fence_enable_signaling()
577 else if (!--fctx->notify_ref) in nouveau_fence_enable_signaling()
578 nvif_notify_put(&fctx->notify); in nouveau_fence_enable_signaling()