36 u32 *
mem = ttm_kmap_obj_virtual(&chan->
push.buffer->kmap, &is_iomem);
37 mem = &mem[chan->
dma.cur];
41 memcpy(mem, data, nr_dwords * 4);
42 chan->
dma.cur += nr_dwords;
65 if (val != *prev_get) {
70 if ((++*timeout & 0xff) == 0) {
72 if (*timeout > 100000)
76 if (val < chan->
push.vma.offset ||
77 val > chan->
push.vma.offset + (chan->
dma.max << 2))
80 return (val - chan->
push.vma.offset) >> 2;
89 int ip = (chan->
dma.ib_put * 2) + chan->
dma.ib_base;
101 chan->
dma.ib_put = (chan->
dma.ib_put + 1) & chan->
dma.ib_max;
107 nv_wo32(chan->
object, 0x8c, chan->
dma.ib_put);
116 while (chan->
dma.ib_free < count) {
118 if (
get != prev_get) {
123 if ((++cnt & 0xff) == 0) {
129 chan->
dma.ib_free =
get - chan->
dma.ib_put;
130 if (chan->
dma.ib_free <= 0)
131 chan->
dma.ib_free += chan->
dma.ib_max;
143 ret = nv50_dma_push_wait(chan, slots + 1);
147 while (chan->
dma.free < count) {
148 int get =
READ_GET(chan, &prev_get, &cnt);
156 if (get <= chan->
dma.cur) {
157 chan->
dma.free = chan->
dma.max - chan->
dma.cur;
158 if (chan->
dma.free >= count)
163 get =
READ_GET(chan, &prev_get, &cnt);
174 chan->
dma.free =
get - chan->
dma.cur - 1;
186 if (chan->
dma.ib_max)
187 return nv50_dma_wait(chan, slots, size);
189 while (chan->
dma.free < size) {
190 get =
READ_GET(chan, &prev_get, &cnt);
206 if (get <= chan->
dma.cur) {
220 chan->
dma.free = chan->
dma.max - chan->
dma.cur;
221 if (chan->
dma.free >= size)
236 get =
READ_GET(chan, &prev_get, &cnt);
257 chan->
dma.free =
get - chan->
dma.cur - 1;