Lines Matching refs:imem

74 nvkm_instobj_dtor(struct nvkm_instmem *imem, struct nvkm_instobj *iobj)  in nvkm_instobj_dtor()  argument
76 spin_lock(&imem->lock); in nvkm_instobj_dtor()
78 spin_unlock(&imem->lock); in nvkm_instobj_dtor()
83 struct nvkm_instmem *imem, struct nvkm_instobj *iobj) in nvkm_instobj_ctor() argument
87 spin_lock(&imem->lock); in nvkm_instobj_ctor()
88 list_add_tail(&iobj->head, &imem->list); in nvkm_instobj_ctor()
89 spin_unlock(&imem->lock); in nvkm_instobj_ctor()
96 struct nvkm_instmem *imem = device->imem; in nvkm_instobj_wrap() local
98 if (!imem->func->memory_wrap) in nvkm_instobj_wrap()
101 return imem->func->memory_wrap(imem, memory, pmemory); in nvkm_instobj_wrap()
105 nvkm_instobj_new(struct nvkm_instmem *imem, u32 size, u32 align, bool zero, in nvkm_instobj_new() argument
108 struct nvkm_subdev *subdev = &imem->subdev; in nvkm_instobj_new()
113 ret = imem->func->memory_new(imem, size, align, zero, &memory); in nvkm_instobj_new()
122 if (!imem->func->zero && zero) { in nvkm_instobj_new()
145 nvkm_instmem_rd32(struct nvkm_instmem *imem, u32 addr) in nvkm_instmem_rd32() argument
147 return imem->func->rd32(imem, addr); in nvkm_instmem_rd32()
151 nvkm_instmem_wr32(struct nvkm_instmem *imem, u32 addr, u32 data) in nvkm_instmem_wr32() argument
153 return imem->func->wr32(imem, addr, data); in nvkm_instmem_wr32()
157 nvkm_instmem_boot(struct nvkm_instmem *imem) in nvkm_instmem_boot() argument
164 spin_lock(&imem->lock); in nvkm_instmem_boot()
165 list_for_each_entry_safe(iobj, itmp, &imem->list, head) { in nvkm_instmem_boot()
166 list_move_tail(&iobj->head, &imem->boot); in nvkm_instmem_boot()
168 spin_unlock(&imem->lock); in nvkm_instmem_boot()
174 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_fini() local
178 list_for_each_entry(iobj, &imem->list, head) { in nvkm_instmem_fini()
186 list_for_each_entry(iobj, &imem->boot, head) { in nvkm_instmem_fini()
193 if (imem->func->fini) in nvkm_instmem_fini()
194 imem->func->fini(imem); in nvkm_instmem_fini()
202 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_init() local
205 list_for_each_entry(iobj, &imem->boot, head) { in nvkm_instmem_init()
212 list_for_each_entry(iobj, &imem->list, head) { in nvkm_instmem_init()
223 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_oneinit() local
224 if (imem->func->oneinit) in nvkm_instmem_oneinit()
225 return imem->func->oneinit(imem); in nvkm_instmem_oneinit()
232 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_dtor() local
233 void *data = imem; in nvkm_instmem_dtor()
234 if (imem->func->dtor) in nvkm_instmem_dtor()
235 data = imem->func->dtor(imem); in nvkm_instmem_dtor()
236 mutex_destroy(&imem->mutex); in nvkm_instmem_dtor()
250 enum nvkm_subdev_type type, int inst, struct nvkm_instmem *imem) in nvkm_instmem_ctor() argument
252 nvkm_subdev_ctor(&nvkm_instmem, device, type, inst, &imem->subdev); in nvkm_instmem_ctor()
253 imem->func = func; in nvkm_instmem_ctor()
254 spin_lock_init(&imem->lock); in nvkm_instmem_ctor()
255 INIT_LIST_HEAD(&imem->list); in nvkm_instmem_ctor()
256 INIT_LIST_HEAD(&imem->boot); in nvkm_instmem_ctor()
257 mutex_init(&imem->mutex); in nvkm_instmem_ctor()