Lines Matching refs:chan
41 READ_GET(struct nouveau_channel *chan, uint64_t *prev_get, int *timeout) in READ_GET() argument
45 val = nvif_rd32(&chan->user, chan->user_get); in READ_GET()
46 if (chan->user_get_hi) in READ_GET()
47 val |= (uint64_t)nvif_rd32(&chan->user, chan->user_get_hi) << 32; in READ_GET()
64 if (val < chan->push.addr || in READ_GET()
65 val > chan->push.addr + (chan->dma.max << 2)) in READ_GET()
68 return (val - chan->push.addr) >> 2; in READ_GET()
72 nv50_dma_push(struct nouveau_channel *chan, u64 offset, int length) in nv50_dma_push() argument
74 struct nvif_user *user = &chan->drm->client.device.user; in nv50_dma_push()
75 struct nouveau_bo *pb = chan->push.buffer; in nv50_dma_push()
76 int ip = (chan->dma.ib_put * 2) + chan->dma.ib_base; in nv50_dma_push()
78 BUG_ON(chan->dma.ib_free < 1); in nv50_dma_push()
83 chan->dma.ib_put = (chan->dma.ib_put + 1) & chan->dma.ib_max; in nv50_dma_push()
89 nvif_wr32(&chan->user, 0x8c, chan->dma.ib_put); in nv50_dma_push()
91 user->func->doorbell(user, chan->token); in nv50_dma_push()
92 chan->dma.ib_free--; in nv50_dma_push()
96 nv50_dma_push_wait(struct nouveau_channel *chan, int count) in nv50_dma_push_wait() argument
100 while (chan->dma.ib_free < count) { in nv50_dma_push_wait()
101 uint32_t get = nvif_rd32(&chan->user, 0x88); in nv50_dma_push_wait()
113 chan->dma.ib_free = get - chan->dma.ib_put; in nv50_dma_push_wait()
114 if (chan->dma.ib_free <= 0) in nv50_dma_push_wait()
115 chan->dma.ib_free += chan->dma.ib_max; in nv50_dma_push_wait()
122 nv50_dma_wait(struct nouveau_channel *chan, int slots, int count) in nv50_dma_wait() argument
127 ret = nv50_dma_push_wait(chan, slots + 1); in nv50_dma_wait()
131 while (chan->dma.free < count) { in nv50_dma_wait()
132 int get = READ_GET(chan, &prev_get, &cnt); in nv50_dma_wait()
140 if (get <= chan->dma.cur) { in nv50_dma_wait()
141 chan->dma.free = chan->dma.max - chan->dma.cur; in nv50_dma_wait()
142 if (chan->dma.free >= count) in nv50_dma_wait()
145 FIRE_RING(chan); in nv50_dma_wait()
147 get = READ_GET(chan, &prev_get, &cnt); in nv50_dma_wait()
154 chan->dma.cur = 0; in nv50_dma_wait()
155 chan->dma.put = 0; in nv50_dma_wait()
158 chan->dma.free = get - chan->dma.cur - 1; in nv50_dma_wait()
165 nouveau_dma_wait(struct nouveau_channel *chan, int slots, int size) in nouveau_dma_wait() argument
170 if (chan->dma.ib_max) in nouveau_dma_wait()
171 return nv50_dma_wait(chan, slots, size); in nouveau_dma_wait()
173 while (chan->dma.free < size) { in nouveau_dma_wait()
174 get = READ_GET(chan, &prev_get, &cnt); in nouveau_dma_wait()
190 if (get <= chan->dma.cur) { in nouveau_dma_wait()
204 chan->dma.free = chan->dma.max - chan->dma.cur; in nouveau_dma_wait()
205 if (chan->dma.free >= size) in nouveau_dma_wait()
212 OUT_RING(chan, chan->push.addr | 0x20000000); in nouveau_dma_wait()
220 get = READ_GET(chan, &prev_get, &cnt); in nouveau_dma_wait()
231 chan->dma.cur = in nouveau_dma_wait()
232 chan->dma.put = NOUVEAU_DMA_SKIPS; in nouveau_dma_wait()
241 chan->dma.free = get - chan->dma.cur - 1; in nouveau_dma_wait()