drm/nouveau/secboot/gm200: initialise vmm with new interfaces
authorBen Skeggs <bskeggs@redhat.com>
Tue, 31 Oct 2017 17:56:19 +0000 (03:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 2 Nov 2017 03:32:30 +0000 (13:32 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h

index 6c068c5bd3c2d0713c1e8b3c9701a88f7b406627..5722295cb5840325a1a050284907adecc9451a0f 100644 (file)
@@ -48,13 +48,13 @@ gm200_secboot_run_blob(struct nvkm_secboot *sb, struct nvkm_gpuobj *blob,
                return ret;
 
        /* Map the HS firmware so the HS bootloader can see it */
-       ret = nvkm_vm_get(gsb->vm, blob->size, 12, NV_MEM_ACCESS_RW, &vma);
+       ret = nvkm_vm_get(gsb->vmm, blob->size, 12, NV_MEM_ACCESS_RW, &vma);
        if (ret) {
                nvkm_falcon_put(falcon, subdev);
                return ret;
        }
 
-       ret = nvkm_memory_map(blob, 0, gsb->vm, &vma, NULL, 0);
+       ret = nvkm_memory_map(blob, 0, gsb->vmm, &vma, NULL, 0);
        if (ret)
                goto end;
 
@@ -107,8 +107,6 @@ gm200_secboot_oneinit(struct nvkm_secboot *sb)
 {
        struct gm200_secboot *gsb = gm200_secboot(sb);
        struct nvkm_device *device = sb->subdev.device;
-       struct nvkm_vm *vm;
-       const u64 vm_area_len = 600 * 1024;
        int ret;
 
        /* Allocate instance block and VM */
@@ -117,14 +115,15 @@ gm200_secboot_oneinit(struct nvkm_secboot *sb)
        if (ret)
                return ret;
 
-       ret = nvkm_vm_new(device, 0, vm_area_len, 0, NULL, &vm);
+       ret = nvkm_vmm_new(device, 0, 600 * 1024, NULL, 0, NULL, "acr",
+                          &gsb->vmm);
        if (ret)
                return ret;
 
-       atomic_inc(&vm->engref[NVKM_SUBDEV_PMU]);
+       atomic_inc(&gsb->vmm->engref[NVKM_SUBDEV_PMU]);
+       gsb->vmm->debug = gsb->base.subdev.debug;
 
-       ret = nvkm_vm_ref(vm, &gsb->vm, gsb->inst);
-       nvkm_vm_ref(NULL, &vm, NULL);
+       ret = nvkm_vmm_join(gsb->vmm, gsb->inst);
        if (ret)
                return ret;
 
@@ -155,7 +154,8 @@ gm200_secboot_dtor(struct nvkm_secboot *sb)
 
        sb->acr->func->dtor(sb->acr);
 
-       nvkm_vm_ref(NULL, &gsb->vm, gsb->inst);
+       nvkm_vmm_part(gsb->vmm, gsb->inst);
+       nvkm_vmm_unref(&gsb->vmm);
        nvkm_memory_unref(&gsb->inst);
 
        return gsb;
index a2b60fab42e882e91e0eff2921f88913d6cc0c77..62c5e162099aaa50b59cde15fda75420a188526a 100644 (file)
@@ -30,7 +30,7 @@ struct gm200_secboot {
 
        /* Instance block & address space used for HS FW execution */
        struct nvkm_memory *inst;
-       struct nvkm_vm *vm;
+       struct nvkm_vmm *vmm;
 };
 #define gm200_secboot(sb) container_of(sb, struct gm200_secboot, base)