• Home
  • Raw
  • Download

Lines Matching refs:iobj

58 	struct nv50_instobj *iobj = nv50_instobj(memory);  in nv50_instobj_wr32_slow()  local
59 struct nv50_instmem *imem = iobj->imem; in nv50_instobj_wr32_slow()
61 u64 base = (nvkm_memory_addr(iobj->ram) + offset) & 0xffffff00000ULL; in nv50_instobj_wr32_slow()
62 u64 addr = (nvkm_memory_addr(iobj->ram) + offset) & 0x000000fffffULL; in nv50_instobj_wr32_slow()
77 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_rd32_slow() local
78 struct nv50_instmem *imem = iobj->imem; in nv50_instobj_rd32_slow()
80 u64 base = (nvkm_memory_addr(iobj->ram) + offset) & 0xffffff00000ULL; in nv50_instobj_rd32_slow()
81 u64 addr = (nvkm_memory_addr(iobj->ram) + offset) & 0x000000fffffULL; in nv50_instobj_rd32_slow()
120 nv50_instobj_kmap(struct nv50_instobj *iobj, struct nvkm_vmm *vmm) in nv50_instobj_kmap() argument
122 struct nv50_instmem *imem = iobj->imem; in nv50_instobj_kmap()
124 struct nvkm_memory *memory = &iobj->base.memory; in nv50_instobj_kmap()
164 if (ret || iobj->bar) { in nv50_instobj_kmap()
173 iobj->bar = bar; in nv50_instobj_kmap()
174 iobj->map = ioremap_wc(device->func->resource_addr(device, 3) + in nv50_instobj_kmap()
175 (u32)iobj->bar->addr, size); in nv50_instobj_kmap()
176 if (!iobj->map) { in nv50_instobj_kmap()
178 nvkm_vmm_put(vmm, &iobj->bar); in nv50_instobj_kmap()
193 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_release() local
194 struct nv50_instmem *imem = iobj->imem; in nv50_instobj_release()
200 if (refcount_dec_and_mutex_lock(&iobj->maps, &imem->base.mutex)) { in nv50_instobj_release()
204 if (likely(iobj->lru.next) && iobj->map) { in nv50_instobj_release()
205 BUG_ON(!list_empty(&iobj->lru)); in nv50_instobj_release()
206 list_add_tail(&iobj->lru, &imem->lru); in nv50_instobj_release()
210 iobj->base.memory.ptrs = NULL; in nv50_instobj_release()
218 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_acquire() local
219 struct nvkm_instmem *imem = &iobj->imem->base; in nv50_instobj_acquire()
224 if (refcount_inc_not_zero(&iobj->maps)) { in nv50_instobj_acquire()
227 return iobj->map; in nv50_instobj_acquire()
234 if (refcount_inc_not_zero(&iobj->maps)) { in nv50_instobj_acquire()
236 return iobj->map; in nv50_instobj_acquire()
241 if (!iobj->map) in nv50_instobj_acquire()
242 nv50_instobj_kmap(iobj, vmm); in nv50_instobj_acquire()
243 map = iobj->map; in nv50_instobj_acquire()
246 if (!refcount_inc_not_zero(&iobj->maps)) { in nv50_instobj_acquire()
248 if (likely(iobj->lru.next)) in nv50_instobj_acquire()
249 list_del_init(&iobj->lru); in nv50_instobj_acquire()
252 iobj->base.memory.ptrs = &nv50_instobj_fast; in nv50_instobj_acquire()
254 iobj->base.memory.ptrs = &nv50_instobj_slow; in nv50_instobj_acquire()
257 refcount_set(&iobj->maps, 1); in nv50_instobj_acquire()
267 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_boot() local
268 struct nvkm_instmem *imem = &iobj->imem->base; in nv50_instobj_boot()
274 if (likely(iobj->lru.next)) { in nv50_instobj_boot()
275 list_del_init(&iobj->lru); in nv50_instobj_boot()
276 iobj->lru.next = NULL; in nv50_instobj_boot()
279 nv50_instobj_kmap(iobj, vmm); in nv50_instobj_boot()
299 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_bar2() local
301 if (nv50_instobj_acquire(&iobj->base.memory)) { in nv50_instobj_bar2()
302 iobj->lru.next = NULL; /* Exclude from eviction. */ in nv50_instobj_bar2()
303 addr = iobj->bar->addr; in nv50_instobj_bar2()
305 nv50_instobj_release(&iobj->base.memory); in nv50_instobj_bar2()
318 struct nv50_instobj *iobj = nv50_instobj(memory); in nv50_instobj_dtor() local
319 struct nvkm_instmem *imem = &iobj->imem->base; in nv50_instobj_dtor()
324 if (likely(iobj->lru.next)) in nv50_instobj_dtor()
325 list_del(&iobj->lru); in nv50_instobj_dtor()
326 map = iobj->map; in nv50_instobj_dtor()
327 bar = iobj->bar; in nv50_instobj_dtor()
337 nvkm_memory_unref(&iobj->ram); in nv50_instobj_dtor()
338 nvkm_instobj_dtor(imem, &iobj->base); in nv50_instobj_dtor()
339 return iobj; in nv50_instobj_dtor()
360 struct nv50_instobj *iobj; in nv50_instobj_wrap() local
362 if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL))) in nv50_instobj_wrap()
364 *pmemory = &iobj->base.memory; in nv50_instobj_wrap()
366 nvkm_instobj_ctor(&nv50_instobj_func, &imem->base, &iobj->base); in nv50_instobj_wrap()
367 iobj->imem = imem; in nv50_instobj_wrap()
368 refcount_set(&iobj->maps, 0); in nv50_instobj_wrap()
369 INIT_LIST_HEAD(&iobj->lru); in nv50_instobj_wrap()
371 iobj->ram = nvkm_memory_ref(memory); in nv50_instobj_wrap()