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
99 if (!imem->func->memory_wrap) in nvkm_instobj_wrap()
102 ret = imem->func->memory_wrap(imem, memory, pmemory); in nvkm_instobj_wrap()
111 nvkm_instobj_new(struct nvkm_instmem *imem, u32 size, u32 align, bool zero, bool preserve, in nvkm_instobj_new() argument
114 struct nvkm_subdev *subdev = &imem->subdev; in nvkm_instobj_new()
119 ret = imem->func->memory_new(imem, size, align, zero, &memory); in nvkm_instobj_new()
128 if (!imem->func->zero && zero) { in nvkm_instobj_new()
152 nvkm_instmem_rd32(struct nvkm_instmem *imem, u32 addr) in nvkm_instmem_rd32() argument
154 return imem->func->rd32(imem, addr); in nvkm_instmem_rd32()
158 nvkm_instmem_wr32(struct nvkm_instmem *imem, u32 addr, u32 data) in nvkm_instmem_wr32() argument
160 return imem->func->wr32(imem, addr, data); in nvkm_instmem_wr32()
164 nvkm_instmem_boot(struct nvkm_instmem *imem) in nvkm_instmem_boot() argument
171 spin_lock(&imem->lock); in nvkm_instmem_boot()
172 list_for_each_entry_safe(iobj, itmp, &imem->list, head) { in nvkm_instmem_boot()
173 list_move_tail(&iobj->head, &imem->boot); in nvkm_instmem_boot()
175 spin_unlock(&imem->lock); in nvkm_instmem_boot()
181 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_fini() local
185 ret = imem->func->suspend(imem); in nvkm_instmem_fini()
189 imem->suspend = true; in nvkm_instmem_fini()
192 if (imem->func->fini) in nvkm_instmem_fini()
193 imem->func->fini(imem); in nvkm_instmem_fini()
201 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_init() local
203 if (imem->suspend) { in nvkm_instmem_init()
204 if (imem->func->resume) in nvkm_instmem_init()
205 imem->func->resume(imem); in nvkm_instmem_init()
207 imem->suspend = false; in nvkm_instmem_init()
218 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_oneinit() local
219 if (imem->func->oneinit) in nvkm_instmem_oneinit()
220 return imem->func->oneinit(imem); in nvkm_instmem_oneinit()
227 struct nvkm_instmem *imem = nvkm_instmem(subdev); in nvkm_instmem_dtor() local
228 void *data = imem; in nvkm_instmem_dtor()
229 if (imem->func->dtor) in nvkm_instmem_dtor()
230 data = imem->func->dtor(imem); in nvkm_instmem_dtor()
231 mutex_destroy(&imem->mutex); in nvkm_instmem_dtor()
245 enum nvkm_subdev_type type, int inst, struct nvkm_instmem *imem) in nvkm_instmem_ctor() argument
247 nvkm_subdev_ctor(&nvkm_instmem, device, type, inst, &imem->subdev); in nvkm_instmem_ctor()
248 imem->func = func; in nvkm_instmem_ctor()
249 spin_lock_init(&imem->lock); in nvkm_instmem_ctor()
250 INIT_LIST_HEAD(&imem->list); in nvkm_instmem_ctor()
251 INIT_LIST_HEAD(&imem->boot); in nvkm_instmem_ctor()
252 mutex_init(&imem->mutex); in nvkm_instmem_ctor()