Lines Matching +full:resume +full:- +full:offset
34 struct nvkm_memory *memory = &iobj->memory; in nvkm_instobj_load()
41 nvkm_wo32(memory, i, iobj->suspend[i / 4]); in nvkm_instobj_load()
43 memcpy_toio(map, iobj->suspend, size); in nvkm_instobj_load()
47 kvfree(iobj->suspend); in nvkm_instobj_load()
48 iobj->suspend = NULL; in nvkm_instobj_load()
54 struct nvkm_memory *memory = &iobj->memory; in nvkm_instobj_save()
59 iobj->suspend = kvmalloc(size, GFP_KERNEL); in nvkm_instobj_save()
60 if (!iobj->suspend) in nvkm_instobj_save()
61 return -ENOMEM; in nvkm_instobj_save()
65 iobj->suspend[i / 4] = nvkm_ro32(memory, i); in nvkm_instobj_save()
67 memcpy_fromio(iobj->suspend, map, size); in nvkm_instobj_save()
76 spin_lock(&imem->lock); in nvkm_instobj_dtor()
77 list_del(&iobj->head); in nvkm_instobj_dtor()
78 spin_unlock(&imem->lock); in nvkm_instobj_dtor()
85 nvkm_memory_ctor(func, &iobj->memory); in nvkm_instobj_ctor()
86 iobj->suspend = NULL; in nvkm_instobj_ctor()
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()
99 if (!imem->func->memory_wrap) in nvkm_instobj_wrap()
100 return -ENOSYS; in nvkm_instobj_wrap()
102 ret = imem->func->memory_wrap(imem, memory, pmemory); in nvkm_instobj_wrap()
106 container_of(*pmemory, struct nvkm_instobj, memory)->preserve = true; in nvkm_instobj_wrap()
114 struct nvkm_subdev *subdev = &imem->subdev; in nvkm_instobj_new()
116 u32 offset; in nvkm_instobj_new() local
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()
131 for (offset = 0; offset < size; offset += 4) in nvkm_instobj_new()
132 nvkm_wo32(memory, offset, 0x00000000); in nvkm_instobj_new()
139 container_of(memory, struct nvkm_instobj, memory)->preserve = preserve; in nvkm_instobj_new()
154 return imem->func->rd32(imem, addr); in nvkm_instmem_rd32()
160 return imem->func->wr32(imem, addr, data); in nvkm_instmem_wr32()
168 * and resume. in nvkm_instmem_boot()
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()
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()
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()
211 nvkm_bar_bar2_init(subdev->device); in nvkm_instmem_init()
219 if (imem->func->oneinit) in nvkm_instmem_oneinit()
220 return imem->func->oneinit(imem); in nvkm_instmem_oneinit()
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()
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()