• Home
  • Raw
  • Download

Lines Matching refs:chan

51 	struct nouveau_channel *chan = container_of(ntfy, typeof(*chan), kill);  in nouveau_channel_killed()  local
52 struct nouveau_cli *cli = (void *)chan->user.client; in nouveau_channel_killed()
53 NV_PRINTK(warn, cli, "channel %d killed!\n", chan->chid); in nouveau_channel_killed()
54 atomic_set(&chan->killed, 1); in nouveau_channel_killed()
55 if (chan->fence) in nouveau_channel_killed()
56 nouveau_fence_context_kill(chan->fence, -ENODEV); in nouveau_channel_killed()
61 nouveau_channel_idle(struct nouveau_channel *chan) in nouveau_channel_idle() argument
63 if (likely(chan && chan->fence && !atomic_read(&chan->killed))) { in nouveau_channel_idle()
64 struct nouveau_cli *cli = (void *)chan->user.client; in nouveau_channel_idle()
68 ret = nouveau_fence_new(chan, false, &fence); in nouveau_channel_idle()
76 chan->chid, nvxx_client(&cli->base)->name); in nouveau_channel_idle()
86 struct nouveau_channel *chan = *pchan; in nouveau_channel_del() local
87 if (chan) { in nouveau_channel_del()
88 struct nouveau_cli *cli = (void *)chan->user.client; in nouveau_channel_del()
96 if (chan->fence) in nouveau_channel_del()
97 nouveau_fence(chan->drm)->context_del(chan); in nouveau_channel_del()
100 nouveau_svmm_part(chan->vmm->svmm, chan->inst); in nouveau_channel_del()
102 nvif_object_dtor(&chan->nvsw); in nouveau_channel_del()
103 nvif_object_dtor(&chan->gart); in nouveau_channel_del()
104 nvif_object_dtor(&chan->vram); in nouveau_channel_del()
105 nvif_notify_dtor(&chan->kill); in nouveau_channel_del()
106 nvif_object_dtor(&chan->user); in nouveau_channel_del()
107 nvif_object_dtor(&chan->push.ctxdma); in nouveau_channel_del()
108 nouveau_vma_del(&chan->push.vma); in nouveau_channel_del()
109 nouveau_bo_unmap(chan->push.buffer); in nouveau_channel_del()
110 if (chan->push.buffer && chan->push.buffer->pin_refcnt) in nouveau_channel_del()
111 nouveau_bo_unpin(chan->push.buffer); in nouveau_channel_del()
112 nouveau_bo_ref(NULL, &chan->push.buffer); in nouveau_channel_del()
113 kfree(chan); in nouveau_channel_del()
124 struct nouveau_channel *chan = container_of(push, typeof(*chan), chan._push); in nouveau_channel_kick() local
125 chan->dma.cur = chan->dma.cur + (chan->chan._push.cur - chan->chan._push.bgn); in nouveau_channel_kick()
126 FIRE_RING(chan); in nouveau_channel_kick()
127 chan->chan._push.bgn = chan->chan._push.cur; in nouveau_channel_kick()
133 struct nouveau_channel *chan = container_of(push, typeof(*chan), chan._push); in nouveau_channel_wait() local
135 chan->dma.cur = chan->dma.cur + (chan->chan._push.cur - chan->chan._push.bgn); in nouveau_channel_wait()
136 ret = RING_SPACE(chan, size); in nouveau_channel_wait()
138 chan->chan._push.bgn = chan->chan._push.mem.object.map.ptr; in nouveau_channel_wait()
139 chan->chan._push.bgn = chan->chan._push.bgn + chan->dma.cur; in nouveau_channel_wait()
140 chan->chan._push.cur = chan->chan._push.bgn; in nouveau_channel_wait()
141 chan->chan._push.end = chan->chan._push.bgn + size; in nouveau_channel_wait()
152 struct nouveau_channel *chan; in nouveau_channel_prep() local
156 chan = *pchan = kzalloc(sizeof(*chan), GFP_KERNEL); in nouveau_channel_prep()
157 if (!chan) in nouveau_channel_prep()
160 chan->device = device; in nouveau_channel_prep()
161 chan->drm = drm; in nouveau_channel_prep()
162 chan->vmm = cli->svm.cli ? &cli->svm : &cli->vmm; in nouveau_channel_prep()
163 atomic_set(&chan->killed, 0); in nouveau_channel_prep()
171 &chan->push.buffer); in nouveau_channel_prep()
173 ret = nouveau_bo_pin(chan->push.buffer, target, false); in nouveau_channel_prep()
175 ret = nouveau_bo_map(chan->push.buffer); in nouveau_channel_prep()
183 chan->chan._push.mem.object.parent = cli->base.object.parent; in nouveau_channel_prep()
184 chan->chan._push.mem.object.client = &cli->base; in nouveau_channel_prep()
185 chan->chan._push.mem.object.name = "chanPush"; in nouveau_channel_prep()
186 chan->chan._push.mem.object.map.ptr = chan->push.buffer->kmap.virtual; in nouveau_channel_prep()
187 chan->chan._push.wait = nouveau_channel_wait; in nouveau_channel_prep()
188 chan->chan._push.kick = nouveau_channel_kick; in nouveau_channel_prep()
189 chan->chan.push = &chan->chan._push; in nouveau_channel_prep()
195 chan->push.addr = chan->push.buffer->offset; in nouveau_channel_prep()
198 ret = nouveau_vma_new(chan->push.buffer, chan->vmm, in nouveau_channel_prep()
199 &chan->push.vma); in nouveau_channel_prep()
205 chan->push.addr = chan->push.vma->addr; in nouveau_channel_prep()
213 args.limit = chan->vmm->vmm.limit - 1; in nouveau_channel_prep()
215 if (chan->push.buffer->bo.mem.mem_type == TTM_PL_VRAM) { in nouveau_channel_prep()
233 if (chan->drm->agp.bridge) { in nouveau_channel_prep()
236 args.start = chan->drm->agp.base; in nouveau_channel_prep()
237 args.limit = chan->drm->agp.base + in nouveau_channel_prep()
238 chan->drm->agp.size - 1; in nouveau_channel_prep()
243 args.limit = chan->vmm->vmm.limit - 1; in nouveau_channel_prep()
249 &chan->push.ctxdma); in nouveau_channel_prep()
279 struct nouveau_channel *chan; in nouveau_channel_ind() local
284 ret = nouveau_channel_prep(drm, device, 0x12000, &chan); in nouveau_channel_ind()
285 *pchan = chan; in nouveau_channel_ind()
294 args.volta.ioffset = 0x10000 + chan->push.addr; in nouveau_channel_ind()
296 args.volta.vmm = nvif_handle(&chan->vmm->vmm.object); in nouveau_channel_ind()
303 args.kepler.ioffset = 0x10000 + chan->push.addr; in nouveau_channel_ind()
305 args.kepler.vmm = nvif_handle(&chan->vmm->vmm.object); in nouveau_channel_ind()
312 args.fermi.ioffset = 0x10000 + chan->push.addr; in nouveau_channel_ind()
313 args.fermi.vmm = nvif_handle(&chan->vmm->vmm.object); in nouveau_channel_ind()
318 args.nv50.ioffset = 0x10000 + chan->push.addr; in nouveau_channel_ind()
319 args.nv50.pushbuf = nvif_handle(&chan->push.ctxdma); in nouveau_channel_ind()
320 args.nv50.vmm = nvif_handle(&chan->vmm->vmm.object); in nouveau_channel_ind()
325 *oclass++, &args, size, &chan->user); in nouveau_channel_ind()
327 if (chan->user.oclass >= VOLTA_CHANNEL_GPFIFO_A) { in nouveau_channel_ind()
328 chan->chid = args.volta.chid; in nouveau_channel_ind()
329 chan->inst = args.volta.inst; in nouveau_channel_ind()
330 chan->token = args.volta.token; in nouveau_channel_ind()
332 if (chan->user.oclass >= KEPLER_CHANNEL_GPFIFO_A) { in nouveau_channel_ind()
333 chan->chid = args.kepler.chid; in nouveau_channel_ind()
334 chan->inst = args.kepler.inst; in nouveau_channel_ind()
336 if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) { in nouveau_channel_ind()
337 chan->chid = args.fermi.chid; in nouveau_channel_ind()
339 chan->chid = args.nv50.chid; in nouveau_channel_ind()
360 struct nouveau_channel *chan; in nouveau_channel_dma() local
364 ret = nouveau_channel_prep(drm, device, 0x10000, &chan); in nouveau_channel_dma()
365 *pchan = chan; in nouveau_channel_dma()
371 args.pushbuf = nvif_handle(&chan->push.ctxdma); in nouveau_channel_dma()
372 args.offset = chan->push.addr; in nouveau_channel_dma()
377 &chan->user); in nouveau_channel_dma()
379 chan->chid = args.chid; in nouveau_channel_dma()
389 nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) in nouveau_channel_init() argument
391 struct nvif_device *device = chan->device; in nouveau_channel_init()
392 struct nouveau_drm *drm = chan->drm; in nouveau_channel_init()
396 nvif_object_map(&chan->user, NULL, 0); in nouveau_channel_init()
398 if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) { in nouveau_channel_init()
399 ret = nvif_notify_ctor(&chan->user, "abi16ChanKilled", in nouveau_channel_init()
402 NULL, 0, 0, &chan->kill); in nouveau_channel_init()
404 ret = nvif_notify_get(&chan->kill); in nouveau_channel_init()
418 args.limit = chan->vmm->vmm.limit - 1; in nouveau_channel_init()
426 ret = nvif_object_ctor(&chan->user, "abi16ChanVramCtxDma", vram, in nouveau_channel_init()
428 &chan->vram); in nouveau_channel_init()
436 args.limit = chan->vmm->vmm.limit - 1; in nouveau_channel_init()
438 if (chan->drm->agp.bridge) { in nouveau_channel_init()
441 args.start = chan->drm->agp.base; in nouveau_channel_init()
442 args.limit = chan->drm->agp.base + in nouveau_channel_init()
443 chan->drm->agp.size - 1; in nouveau_channel_init()
448 args.limit = chan->vmm->vmm.limit - 1; in nouveau_channel_init()
451 ret = nvif_object_ctor(&chan->user, "abi16ChanGartCtxDma", gart, in nouveau_channel_init()
453 &chan->gart); in nouveau_channel_init()
459 switch (chan->user.oclass & 0x00ff) { in nouveau_channel_init()
462 chan->user_put = 0x40; in nouveau_channel_init()
463 chan->user_get = 0x44; in nouveau_channel_init()
464 chan->dma.max = (0x10000 / 4) - 2; in nouveau_channel_init()
467 chan->user_put = 0x40; in nouveau_channel_init()
468 chan->user_get = 0x44; in nouveau_channel_init()
469 chan->user_get_hi = 0x60; in nouveau_channel_init()
470 chan->dma.ib_base = 0x10000 / 4; in nouveau_channel_init()
471 chan->dma.ib_max = (0x02000 / 8) - 1; in nouveau_channel_init()
472 chan->dma.ib_put = 0; in nouveau_channel_init()
473 chan->dma.ib_free = chan->dma.ib_max - chan->dma.ib_put; in nouveau_channel_init()
474 chan->dma.max = chan->dma.ib_base; in nouveau_channel_init()
478 chan->dma.put = 0; in nouveau_channel_init()
479 chan->dma.cur = chan->dma.put; in nouveau_channel_init()
480 chan->dma.free = chan->dma.max - chan->dma.cur; in nouveau_channel_init()
482 ret = PUSH_WAIT(chan->chan.push, NOUVEAU_DMA_SKIPS); in nouveau_channel_init()
487 PUSH_DATA(chan->chan.push, 0x00000000); in nouveau_channel_init()
491 ret = nvif_object_ctor(&chan->user, "abi16NvswFence", 0x006e, in nouveau_channel_init()
493 NULL, 0, &chan->nvsw); in nouveau_channel_init()
497 ret = PUSH_WAIT(chan->chan.push, 2); in nouveau_channel_init()
501 PUSH_NVSQ(chan->chan.push, NV_SW, 0x0000, chan->nvsw.handle); in nouveau_channel_init()
502 PUSH_KICK(chan->chan.push); in nouveau_channel_init()
506 return nouveau_fence(chan->drm)->context_new(chan); in nouveau_channel_init()
568 drm->chan.nr = args.v.channels.data; in nouveau_channels_init()
569 drm->chan.context_base = dma_fence_context_alloc(drm->chan.nr); in nouveau_channels_init()