Lines Matching refs: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()
166 nvkm_fifo_cevent(struct nvkm_fifo *fifo) in nvkm_fifo_cevent() argument
168 nvkm_event_send(&fifo->cevent, 1, 0, NULL, 0); in nvkm_fifo_cevent()
174 struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), uevent); in nvkm_fifo_uevent_fini() local
175 fifo->func->uevent_fini(fifo); in nvkm_fifo_uevent_fini()
181 struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), uevent); in nvkm_fifo_uevent_init() local
182 fifo->func->uevent_init(fifo); in nvkm_fifo_uevent_init()
211 nvkm_fifo_uevent(struct nvkm_fifo *fifo) in nvkm_fifo_uevent() argument
215 nvkm_event_send(&fifo->uevent, 1, 0, &rep, sizeof(rep)); in nvkm_fifo_uevent()
223 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_new_() local
224 return fifo->func->class_new(fifo, oclass, data, size, pobject); in nvkm_fifo_class_new_()
238 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_new() local
239 return sclass->ctor(fifo, oclass, data, size, pobject); in nvkm_fifo_class_new()
251 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_get() local
255 if (fifo->func->class_get) { in nvkm_fifo_class_get()
256 int ret = fifo->func->class_get(fifo, index, oclass); in nvkm_fifo_class_get()
262 while ((sclass = fifo->func->chan[c])) { in nvkm_fifo_class_get()
277 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_intr() local
278 fifo->func->intr(fifo); in nvkm_fifo_intr()
284 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_fini() local
285 if (fifo->func->fini) in nvkm_fifo_fini()
286 fifo->func->fini(fifo); in nvkm_fifo_fini()
293 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_info() local
295 case NV_DEVICE_FIFO_CHANNELS: *data = fifo->nr; return 0; in nvkm_fifo_info()
297 if (fifo->func->info) in nvkm_fifo_info()
298 return fifo->func->info(fifo, mthd, data); in nvkm_fifo_info()
307 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_oneinit() local
308 if (fifo->func->oneinit) in nvkm_fifo_oneinit()
309 return fifo->func->oneinit(fifo); in nvkm_fifo_oneinit()
322 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_init() local
323 fifo->func->init(fifo); in nvkm_fifo_init()
330 struct nvkm_fifo *fifo = nvkm_fifo(engine); in nvkm_fifo_dtor() local
331 void *data = fifo; in nvkm_fifo_dtor()
332 if (fifo->func->dtor) in nvkm_fifo_dtor()
333 data = fifo->func->dtor(fifo); in nvkm_fifo_dtor()
334 nvkm_event_fini(&fifo->kevent); in nvkm_fifo_dtor()
335 nvkm_event_fini(&fifo->cevent); in nvkm_fifo_dtor()
336 nvkm_event_fini(&fifo->uevent); in nvkm_fifo_dtor()
354 int index, int nr, struct nvkm_fifo *fifo) in nvkm_fifo_ctor() argument
358 fifo->func = func; in nvkm_fifo_ctor()
359 INIT_LIST_HEAD(&fifo->chan); in nvkm_fifo_ctor()
360 spin_lock_init(&fifo->lock); in nvkm_fifo_ctor()
362 if (WARN_ON(fifo->nr > NVKM_FIFO_CHID_NR)) in nvkm_fifo_ctor()
363 fifo->nr = NVKM_FIFO_CHID_NR; in nvkm_fifo_ctor()
365 fifo->nr = nr; in nvkm_fifo_ctor()
366 bitmap_clear(fifo->mask, 0, fifo->nr); in nvkm_fifo_ctor()
368 ret = nvkm_engine_ctor(&nvkm_fifo, device, index, true, &fifo->engine); in nvkm_fifo_ctor()
374 &fifo->uevent); in nvkm_fifo_ctor()
379 ret = nvkm_event_init(&nvkm_fifo_cevent_func, 1, 1, &fifo->cevent); in nvkm_fifo_ctor()
383 return nvkm_event_init(&nvkm_fifo_kevent_func, 1, nr, &fifo->kevent); in nvkm_fifo_ctor()