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()
93 nvkm_instobj_new(struct nvkm_instmem *imem, u32 size, u32 align, bool zero, in nvkm_instobj_new() argument
96 struct nvkm_subdev *subdev = &imem->subdev; in nvkm_instobj_new()
101 ret = imem->func->memory_new(imem, size, align, zero, &memory); in nvkm_instobj_new()
110 if (!imem->func->zero && zero) { in nvkm_instobj_new()
133 nvkm_instmem_rd32(struct nvkm_instmem *imem, u32 addr) in nvkm_instmem_rd32() argument
135 return imem->func->rd32(imem, addr); in nvkm_instmem_rd32()
139 nvkm_instmem_wr32(struct nvkm_instmem *imem, u32 addr, u32 data) in nvkm_instmem_wr32() argument
141 return imem->func->wr32(imem, addr, data); in nvkm_instmem_wr32()
145 nvkm_instmem_boot(struct nvkm_instmem *imem) in nvkm_instmem_boot() argument
152 spin_lock(&imem->lock); in nvkm_instmem_boot()
153 list_for_each_entry_safe(iobj, itmp, &imem->list, head) { in nvkm_instmem_boot()
154 list_move_tail(&iobj->head, &imem->boot); in nvkm_instmem_boot()
156 spin_unlock(&imem->lock); in nvkm_instmem_boot()
162 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_fini() local
166 list_for_each_entry(iobj, &imem->list, head) { in nvkm_instmem_fini()
174 list_for_each_entry(iobj, &imem->boot, head) { in nvkm_instmem_fini()
181 if (imem->func->fini) in nvkm_instmem_fini()
182 imem->func->fini(imem); in nvkm_instmem_fini()
190 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_init() local
193 list_for_each_entry(iobj, &imem->boot, head) { in nvkm_instmem_init()
200 list_for_each_entry(iobj, &imem->list, head) { in nvkm_instmem_init()
211 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_oneinit() local
212 if (imem->func->oneinit) in nvkm_instmem_oneinit()
213 return imem->func->oneinit(imem); in nvkm_instmem_oneinit()
220 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_dtor() local
221 void *data = imem; in nvkm_instmem_dtor()
222 if (imem->func->dtor) in nvkm_instmem_dtor()
223 data = imem->func->dtor(imem); in nvkm_instmem_dtor()
224 mutex_destroy(&imem->mutex); in nvkm_instmem_dtor()
238 enum nvkm_subdev_type type, int inst, struct nvkm_instmem *imem) in nvkm_instmem_ctor() argument
240 nvkm_subdev_ctor(&nvkm_instmem, device, type, inst, &imem->subdev); in nvkm_instmem_ctor()
241 imem->func = func; in nvkm_instmem_ctor()
242 spin_lock_init(&imem->lock); in nvkm_instmem_ctor()
243 INIT_LIST_HEAD(&imem->list); in nvkm_instmem_ctor()
244 INIT_LIST_HEAD(&imem->boot); in nvkm_instmem_ctor()
245 mutex_init(&imem->mutex); in nvkm_instmem_ctor()