drm/nouveau/fb/ram: use new interfaces for vmm operations
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/fb/ram.c

index 03a860a..5305078 100644 (file)
@@ -39,12 +39,22 @@ nvkm_vram_map(struct nvkm_memory *memory, u64 offset, struct nvkm_vmm *vmm,
              struct nvkm_vma *vma, void *argv, u32 argc)
 {
        struct nvkm_vram *vram = nvkm_vram(memory);
-       struct nvkm_mem mem = {
-               .mem = vram->mn,
+       struct nvkm_vmm_map map = {
                .memory = &vram->memory,
+               .offset = offset,
+               .mem = vram->mn,
        };
-       nvkm_vm_map_at(vma, offset, &mem);
-       return 0;
+
+       if (vma->vm) {
+               struct nvkm_mem mem = {
+                       .mem = vram->mn,
+                       .memory = &vram->memory,
+               };
+               nvkm_vm_map_at(vma, offset, &mem);
+               return 0;
+       }
+
+       return nvkm_vmm_map(vmm, vma, argv, argc, &map);
 }
 
 static u64