Lines Matching full:dmac

119 nv50_dmac_destroy(struct nv50_dmac *dmac)  in nv50_dmac_destroy()  argument
121 nvif_object_dtor(&dmac->vram); in nv50_dmac_destroy()
122 nvif_object_dtor(&dmac->sync); in nv50_dmac_destroy()
124 nv50_chan_destroy(&dmac->base); in nv50_dmac_destroy()
126 nvif_mem_dtor(&dmac->_push.mem); in nv50_dmac_destroy()
132 struct nv50_dmac *dmac = container_of(push, typeof(*dmac), _push); in nv50_dmac_kick() local
134 dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr; in nv50_dmac_kick()
135 if (dmac->put != dmac->cur) { in nv50_dmac_kick()
139 if (dmac->push->mem.type & NVIF_MEM_VRAM) { in nv50_dmac_kick()
140 struct nvif_device *device = dmac->base.device; in nv50_dmac_kick()
148 NVIF_WV32(&dmac->base.user, NV507C, PUT, PTR, dmac->cur); in nv50_dmac_kick()
149 dmac->put = dmac->cur; in nv50_dmac_kick()
156 nv50_dmac_free(struct nv50_dmac *dmac) in nv50_dmac_free() argument
158 u32 get = NVIF_RV32(&dmac->base.user, NV507C, GET, PTR); in nv50_dmac_free()
159 if (get > dmac->cur) /* NVIDIA stay 5 away from GET, do the same. */ in nv50_dmac_free()
160 return get - dmac->cur - 5; in nv50_dmac_free()
161 return dmac->max - dmac->cur; in nv50_dmac_free()
165 nv50_dmac_wind(struct nv50_dmac *dmac) in nv50_dmac_wind() argument
170 u32 get = NVIF_RV32(&dmac->base.user, NV507C, GET, PTR); in nv50_dmac_wind()
173 if (dmac->put == 0) in nv50_dmac_wind()
174 nv50_dmac_kick(dmac->push); in nv50_dmac_wind()
176 if (nvif_msec(dmac->base.device, 2000, in nv50_dmac_wind()
177 if (NVIF_TV32(&dmac->base.user, NV507C, GET, PTR, >, 0)) in nv50_dmac_wind()
183 PUSH_RSVD(dmac->push, PUSH_JUMP(dmac->push, 0)); in nv50_dmac_wind()
184 dmac->cur = 0; in nv50_dmac_wind()
191 struct nv50_dmac *dmac = container_of(push, typeof(*dmac), _push); in nv50_dmac_wait() local
194 if (WARN_ON(size > dmac->max)) in nv50_dmac_wait()
197 dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr; in nv50_dmac_wait()
198 if (dmac->cur + size >= dmac->max) { in nv50_dmac_wait()
199 int ret = nv50_dmac_wind(dmac); in nv50_dmac_wait()
203 push->cur = dmac->_push.mem.object.map.ptr; in nv50_dmac_wait()
204 push->cur = push->cur + dmac->cur; in nv50_dmac_wait()
208 if (nvif_msec(dmac->base.device, 2000, in nv50_dmac_wait()
209 if ((free = nv50_dmac_free(dmac)) >= size) in nv50_dmac_wait()
216 push->bgn = dmac->_push.mem.object.map.ptr; in nv50_dmac_wait()
217 push->bgn = push->bgn + dmac->cur; in nv50_dmac_wait()
230 struct nv50_dmac *dmac) in nv50_dmac_create() argument
237 mutex_init(&dmac->lock); in nv50_dmac_create()
253 &dmac->_push.mem); in nv50_dmac_create()
257 dmac->ptr = dmac->_push.mem.object.map.ptr; in nv50_dmac_create()
258 dmac->_push.wait = nv50_dmac_wait; in nv50_dmac_create()
259 dmac->_push.kick = nv50_dmac_kick; in nv50_dmac_create()
260 dmac->push = &dmac->_push; in nv50_dmac_create()
261 dmac->push->bgn = dmac->_push.mem.object.map.ptr; in nv50_dmac_create()
262 dmac->push->cur = dmac->push->bgn; in nv50_dmac_create()
263 dmac->push->end = dmac->push->bgn; in nv50_dmac_create()
264 dmac->max = 0x1000/4 - 1; in nv50_dmac_create()
270 dmac->max -= 12; in nv50_dmac_create()
272 args->pushbuf = nvif_handle(&dmac->_push.mem.object); in nv50_dmac_create()
275 &dmac->base); in nv50_dmac_create()
282 ret = nvif_object_ctor(&dmac->base.user, "kmsSyncCtxDma", NV50_DISP_HANDLE_SYNCBUF, in nv50_dmac_create()
290 &dmac->sync); in nv50_dmac_create()
294 ret = nvif_object_ctor(&dmac->base.user, "kmsVramCtxDma", NV50_DISP_HANDLE_VRAM, in nv50_dmac_create()
302 &dmac->vram); in nv50_dmac_create()