Lines Matching full:fifo
37 nvkm_fifo_recover_chan(struct nvkm_fifo *fifo, int chid) in nvkm_fifo_recover_chan() argument
40 if (WARN_ON(!fifo->func->recover_chan)) in nvkm_fifo_recover_chan()
42 spin_lock_irqsave(&fifo->lock, flags); in nvkm_fifo_recover_chan()
43 fifo->func->recover_chan(fifo, chid); in nvkm_fifo_recover_chan()
44 spin_unlock_irqrestore(&fifo->lock, flags); in nvkm_fifo_recover_chan()
48 nvkm_fifo_pause(struct nvkm_fifo *fifo, unsigned long *flags) in nvkm_fifo_pause() argument
50 return fifo->func->pause(fifo, flags); in nvkm_fifo_pause()
54 nvkm_fifo_start(struct nvkm_fifo *fifo, unsigned long *flags) in nvkm_fifo_start() argument
56 return fifo->func->start(fifo, flags); in nvkm_fifo_start()
60 nvkm_fifo_fault(struct nvkm_fifo *fifo, struct nvkm_fault_data *info) in nvkm_fifo_fault() argument
62 return fifo->func->fault(fifo, info); in nvkm_fifo_fault()
66 nvkm_fifo_chan_put(struct nvkm_fifo *fifo, unsigned long flags, in nvkm_fifo_chan_put() argument
72 spin_unlock_irqrestore(&fifo->lock, flags); in nvkm_fifo_chan_put()
77 nvkm_fifo_chan_inst_locked(struct nvkm_fifo *fifo, u64 inst) in nvkm_fifo_chan_inst_locked() argument
80 list_for_each_entry(chan, &fifo->chan, head) { in nvkm_fifo_chan_inst_locked()
83 list_add(&chan->head, &fifo->chan); in nvkm_fifo_chan_inst_locked()
91 nvkm_fifo_chan_inst(struct nvkm_fifo *fifo, u64 inst, unsigned long *rflags) in nvkm_fifo_chan_inst() argument
95 spin_lock_irqsave(&fifo->lock, flags); in nvkm_fifo_chan_inst()
96 if ((chan = nvkm_fifo_chan_inst_locked(fifo, inst))) { in nvkm_fifo_chan_inst()
100 spin_unlock_irqrestore(&fifo->lock, flags); in nvkm_fifo_chan_inst()
105 nvkm_fifo_chan_chid(struct nvkm_fifo *fifo, int chid, unsigned long *rflags) in nvkm_fifo_chan_chid() argument
109 spin_lock_irqsave(&fifo->lock, flags); in nvkm_fifo_chan_chid()
110 list_for_each_entry(chan, &fifo->chan, head) { in nvkm_fifo_chan_chid()
113 list_add(&chan->head, &fifo->chan); in nvkm_fifo_chan_chid()
118 spin_unlock_irqrestore(&fifo->lock, flags); in nvkm_fifo_chan_chid()
123 nvkm_fifo_kevent(struct nvkm_fifo *fifo, int chid) in nvkm_fifo_kevent() argument
125 nvkm_event_send(&fifo->kevent, 1, chid, NULL, 0); in nvkm_fifo_kevent()
150 struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), uevent); in nvkm_fifo_uevent_fini() local
151 fifo->func->uevent_fini(fifo); in nvkm_fifo_uevent_fini()
157 struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), uevent); in nvkm_fifo_uevent_init() local
158 fifo->func->uevent_init(fifo); in nvkm_fifo_uevent_init()
187 nvkm_fifo_uevent(struct nvkm_fifo *fifo) in nvkm_fifo_uevent() argument
191 nvkm_event_send(&fifo->uevent, 1, 0, &rep, sizeof(rep)); in nvkm_fifo_uevent()
199 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_new_() local
200 return fifo->func->class_new(fifo, oclass, data, size, pobject); in nvkm_fifo_class_new_()
214 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_new() local
215 return sclass->ctor(fifo, oclass, data, size, pobject); in nvkm_fifo_class_new()
227 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_get() local
231 if (fifo->func->class_get) { in nvkm_fifo_class_get()
232 int ret = fifo->func->class_get(fifo, index, oclass); in nvkm_fifo_class_get()
238 while ((sclass = fifo->func->chan[c])) { in nvkm_fifo_class_get()
253 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_intr() local
254 fifo->func->intr(fifo); in nvkm_fifo_intr()
260 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_fini() local
261 if (fifo->func->fini) in nvkm_fifo_fini()
262 fifo->func->fini(fifo); in nvkm_fifo_fini()
269 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_info() local
271 case NV_DEVICE_HOST_CHANNELS: *data = fifo->nr; return 0; in nvkm_fifo_info()
273 if (fifo->func->info) in nvkm_fifo_info()
274 return fifo->func->info(fifo, mthd, data); in nvkm_fifo_info()
283 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_oneinit() local
284 if (fifo->func->oneinit) in nvkm_fifo_oneinit()
285 return fifo->func->oneinit(fifo); in nvkm_fifo_oneinit()
298 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_init() local
299 fifo->func->init(fifo); in nvkm_fifo_init()
306 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_dtor() local
307 void *data = fifo; in nvkm_fifo_dtor()
308 if (fifo->func->dtor) in nvkm_fifo_dtor()
309 data = fifo->func->dtor(fifo); in nvkm_fifo_dtor()
310 nvkm_event_fini(&fifo->kevent); in nvkm_fifo_dtor()
311 nvkm_event_fini(&fifo->uevent); in nvkm_fifo_dtor()
312 mutex_destroy(&fifo->mutex); in nvkm_fifo_dtor()
330 enum nvkm_subdev_type type, int inst, int nr, struct nvkm_fifo *fifo) in nvkm_fifo_ctor() argument
334 fifo->func = func; in nvkm_fifo_ctor()
335 INIT_LIST_HEAD(&fifo->chan); in nvkm_fifo_ctor()
336 spin_lock_init(&fifo->lock); in nvkm_fifo_ctor()
337 mutex_init(&fifo->mutex); in nvkm_fifo_ctor()
339 if (WARN_ON(fifo->nr > NVKM_FIFO_CHID_NR)) in nvkm_fifo_ctor()
340 fifo->nr = NVKM_FIFO_CHID_NR; in nvkm_fifo_ctor()
342 fifo->nr = nr; in nvkm_fifo_ctor()
343 bitmap_clear(fifo->mask, 0, fifo->nr); in nvkm_fifo_ctor()
345 ret = nvkm_engine_ctor(&nvkm_fifo, device, type, inst, true, &fifo->engine); in nvkm_fifo_ctor()
351 &fifo->uevent); in nvkm_fifo_ctor()
356 return nvkm_event_init(&nvkm_fifo_kevent_func, 1, nr, &fifo->kevent); in nvkm_fifo_ctor()