Commit e9be3c7d authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/imem: use fast-path for suspend backup

Before: "imem: suspend completed in 5540487us"
 After: "imem: suspend completed in 1871526us"

Suspend from Fedora 26 gnome desktop on GP102.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent b00b8430
...@@ -74,7 +74,6 @@ nvkm_bar_fini(struct nvkm_subdev *subdev, bool suspend) ...@@ -74,7 +74,6 @@ nvkm_bar_fini(struct nvkm_subdev *subdev, bool suspend)
{ {
struct nvkm_bar *bar = nvkm_bar(subdev); struct nvkm_bar *bar = nvkm_bar(subdev);
bar->func->bar1.fini(bar); bar->func->bar1.fini(bar);
nvkm_bar_bar2_fini(subdev->device);
return 0; return 0;
} }
...@@ -101,6 +100,7 @@ static void * ...@@ -101,6 +100,7 @@ static void *
nvkm_bar_dtor(struct nvkm_subdev *subdev) nvkm_bar_dtor(struct nvkm_subdev *subdev)
{ {
struct nvkm_bar *bar = nvkm_bar(subdev); struct nvkm_bar *bar = nvkm_bar(subdev);
nvkm_bar_bar2_fini(subdev->device);
return bar->func->dtor(bar); return bar->func->dtor(bar);
} }
......
...@@ -46,15 +46,20 @@ nvkm_instobj_save(struct nvkm_instobj *iobj) ...@@ -46,15 +46,20 @@ nvkm_instobj_save(struct nvkm_instobj *iobj)
{ {
struct nvkm_memory *memory = &iobj->memory; struct nvkm_memory *memory = &iobj->memory;
const u64 size = nvkm_memory_size(memory); const u64 size = nvkm_memory_size(memory);
void __iomem *map;
int i; int i;
iobj->suspend = kvmalloc(size, GFP_KERNEL); iobj->suspend = kvmalloc(size, GFP_KERNEL);
if (!iobj->suspend) if (!iobj->suspend)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < size; i += 4) if (!(map = nvkm_kmap(memory))) {
iobj->suspend[i / 4] = nvkm_ro32(memory, i); for (i = 0; i < size; i += 4)
iobj->suspend[i / 4] = nvkm_ro32(memory, i);
} else {
memcpy_fromio(iobj->suspend, map, size);
}
nvkm_done(memory);
return 0; return 0;
} }
...@@ -157,6 +162,8 @@ nvkm_instmem_fini(struct nvkm_subdev *subdev, bool suspend) ...@@ -157,6 +162,8 @@ nvkm_instmem_fini(struct nvkm_subdev *subdev, bool suspend)
return ret; return ret;
} }
nvkm_bar_bar2_fini(subdev->device);
list_for_each_entry(iobj, &imem->boot, head) { list_for_each_entry(iobj, &imem->boot, head) {
int ret = nvkm_instobj_save(iobj); int ret = nvkm_instobj_save(iobj);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment