Lines Matching refs:chan

34 	struct nvkm_fifo_chan *chan;  member
39 nvkm_fifo_chan_engn(struct nvkm_fifo_chan *chan, struct nvkm_engine *engine) in nvkm_fifo_chan_engn() argument
41 int engi = chan->fifo->func->engine_id(chan->fifo, engine); in nvkm_fifo_chan_engn()
43 return &chan->engn[engi]; in nvkm_fifo_chan_engn()
53 struct nvkm_fifo_chan *chan = object->chan; in nvkm_fifo_chan_child_fini() local
54 struct nvkm_fifo_engn *engn = nvkm_fifo_chan_engn(chan, engine); in nvkm_fifo_chan_child_fini()
61 if (chan->func->engine_fini) { in nvkm_fifo_chan_child_fini()
62 ret = chan->func->engine_fini(chan, engine, suspend); in nvkm_fifo_chan_child_fini()
64 nvif_error(&chan->object, in nvkm_fifo_chan_child_fini()
76 nvif_trace(&chan->object, "detached %s\n", name); in nvkm_fifo_chan_child_fini()
86 struct nvkm_fifo_chan *chan = object->chan; in nvkm_fifo_chan_child_init() local
87 struct nvkm_fifo_engn *engn = nvkm_fifo_chan_engn(chan, engine); in nvkm_fifo_chan_child_init()
100 if (chan->func->engine_init) { in nvkm_fifo_chan_child_init()
101 ret = chan->func->engine_init(chan, engine); in nvkm_fifo_chan_child_init()
103 nvif_error(&chan->object, in nvkm_fifo_chan_child_init()
109 nvif_trace(&chan->object, "attached %s\n", name); in nvkm_fifo_chan_child_init()
119 struct nvkm_fifo_chan *chan = object->chan; in nvkm_fifo_chan_child_del() local
120 struct nvkm_fifo_engn *engn = nvkm_fifo_chan_engn(chan, engine); in nvkm_fifo_chan_child_del()
122 if (chan->func->object_dtor) in nvkm_fifo_chan_child_del()
123 chan->func->object_dtor(chan, object->hash); in nvkm_fifo_chan_child_del()
126 if (chan->func->engine_dtor) in nvkm_fifo_chan_child_del()
127 chan->func->engine_dtor(chan, engine); in nvkm_fifo_chan_child_del()
129 if (chan->vmm) in nvkm_fifo_chan_child_del()
130 atomic_dec(&chan->vmm->engref[engine->subdev.type]); in nvkm_fifo_chan_child_del()
146 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(oclass->parent); in nvkm_fifo_chan_child_new() local
147 struct nvkm_fifo_engn *engn = nvkm_fifo_chan_engn(chan, engine); in nvkm_fifo_chan_child_new()
154 object->chan = chan; in nvkm_fifo_chan_child_new()
163 if (chan->vmm) in nvkm_fifo_chan_child_new()
164 atomic_inc(&chan->vmm->engref[engine->subdev.type]); in nvkm_fifo_chan_child_new()
167 ret = engine->func->fifo.cclass(chan, &cclass, in nvkm_fifo_chan_child_new()
177 if (chan->func->engine_ctor) { in nvkm_fifo_chan_child_new()
178 ret = chan->func->engine_ctor(chan, oclass->engine, in nvkm_fifo_chan_child_new()
199 if (chan->func->object_ctor) { in nvkm_fifo_chan_child_new()
201 chan->func->object_ctor(chan, object->oproxy.object); in nvkm_fifo_chan_child_new()
213 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_child_get() local
214 struct nvkm_fifo *fifo = chan->fifo; in nvkm_fifo_chan_child_get()
216 u32 engm = chan->engm; in nvkm_fifo_chan_child_get()
257 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_ntfy() local
258 if (chan->func->ntfy) in nvkm_fifo_chan_ntfy()
259 return chan->func->ntfy(chan, type, pevent); in nvkm_fifo_chan_ntfy()
267 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_map() local
269 *addr = chan->addr; in nvkm_fifo_chan_map()
270 *size = chan->size; in nvkm_fifo_chan_map()
277 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_rd32() local
278 if (unlikely(!chan->user)) { in nvkm_fifo_chan_rd32()
279 chan->user = ioremap(chan->addr, chan->size); in nvkm_fifo_chan_rd32()
280 if (!chan->user) in nvkm_fifo_chan_rd32()
283 if (unlikely(addr + 4 > chan->size)) in nvkm_fifo_chan_rd32()
285 *data = ioread32_native(chan->user + addr); in nvkm_fifo_chan_rd32()
292 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_wr32() local
293 if (unlikely(!chan->user)) { in nvkm_fifo_chan_wr32()
294 chan->user = ioremap(chan->addr, chan->size); in nvkm_fifo_chan_wr32()
295 if (!chan->user) in nvkm_fifo_chan_wr32()
298 if (unlikely(addr + 4 > chan->size)) in nvkm_fifo_chan_wr32()
300 iowrite32_native(data, chan->user + addr); in nvkm_fifo_chan_wr32()
307 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_fini() local
308 chan->func->fini(chan); in nvkm_fifo_chan_fini()
315 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_init() local
316 chan->func->init(chan); in nvkm_fifo_chan_init()
323 struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); in nvkm_fifo_chan_dtor() local
324 struct nvkm_fifo *fifo = chan->fifo; in nvkm_fifo_chan_dtor()
325 void *data = chan->func->dtor(chan); in nvkm_fifo_chan_dtor()
329 if (!list_empty(&chan->head)) { in nvkm_fifo_chan_dtor()
330 __clear_bit(chan->chid, fifo->mask); in nvkm_fifo_chan_dtor()
331 list_del(&chan->head); in nvkm_fifo_chan_dtor()
335 if (chan->user) in nvkm_fifo_chan_dtor()
336 iounmap(chan->user); in nvkm_fifo_chan_dtor()
338 if (chan->vmm) { in nvkm_fifo_chan_dtor()
339 nvkm_vmm_part(chan->vmm, chan->inst->memory); in nvkm_fifo_chan_dtor()
340 nvkm_vmm_unref(&chan->vmm); in nvkm_fifo_chan_dtor()
343 nvkm_gpuobj_del(&chan->push); in nvkm_fifo_chan_dtor()
344 nvkm_gpuobj_del(&chan->inst); in nvkm_fifo_chan_dtor()
365 struct nvkm_fifo_chan *chan) in nvkm_fifo_chan_ctor() argument
373 nvkm_object_ctor(&nvkm_fifo_chan_func, oclass, &chan->object); in nvkm_fifo_chan_ctor()
374 chan->func = func; in nvkm_fifo_chan_ctor()
375 chan->fifo = fifo; in nvkm_fifo_chan_ctor()
376 chan->engm = engm; in nvkm_fifo_chan_ctor()
377 INIT_LIST_HEAD(&chan->head); in nvkm_fifo_chan_ctor()
380 ret = nvkm_gpuobj_new(device, size, align, zero, NULL, &chan->inst); in nvkm_fifo_chan_ctor()
390 ret = nvkm_object_bind(&dmaobj->object, chan->inst, -16, in nvkm_fifo_chan_ctor()
391 &chan->push); in nvkm_fifo_chan_ctor()
405 ret = nvkm_vmm_join(vmm, chan->inst->memory); in nvkm_fifo_chan_ctor()
409 chan->vmm = nvkm_vmm_ref(vmm); in nvkm_fifo_chan_ctor()
414 chan->chid = find_first_zero_bit(fifo->mask, NVKM_FIFO_CHID_NR); in nvkm_fifo_chan_ctor()
415 if (chan->chid >= NVKM_FIFO_CHID_NR) { in nvkm_fifo_chan_ctor()
419 list_add(&chan->head, &fifo->chan); in nvkm_fifo_chan_ctor()
420 __set_bit(chan->chid, fifo->mask); in nvkm_fifo_chan_ctor()
424 chan->addr = device->func->resource_addr(device, bar) + in nvkm_fifo_chan_ctor()
425 base + user * chan->chid; in nvkm_fifo_chan_ctor()
426 chan->size = user; in nvkm_fifo_chan_ctor()