diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-10-31 20:56:20 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-11-02 06:32:33 +0300 |
commit | d7722134b8254bcee6086230723814cddf9ab54b (patch) | |
tree | 7c814c6dd29b328f527e9a7af802e0736fa82ad9 /drivers/gpu/drm/nouveau/nouveau_ttm.c | |
parent | 10842ba074e95efad1ac7de2f5279910988f3e68 (diff) | |
download | linux-d7722134b8254bcee6086230723814cddf9ab54b.tar.xz |
drm/nouveau: switch over to new memory and vmm interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ttm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ttm.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 15c1091cccb5..08b974b30482 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -56,15 +56,6 @@ nouveau_manager_debug(struct ttm_mem_type_manager *man, { } -static void -nouveau_vram_manager_del(struct ttm_mem_type_manager *man, - struct ttm_mem_reg *reg) -{ - struct nvkm_memory *memory = nouveau_mem(reg)->_mem->memory; - nouveau_mem_del(reg); - nvkm_memory_unref(&memory); -} - static int nouveau_vram_manager_new(struct ttm_mem_type_manager *man, struct ttm_buffer_object *bo, @@ -101,7 +92,7 @@ const struct ttm_mem_type_manager_func nouveau_vram_manager = { .init = nouveau_manager_init, .takedown = nouveau_manager_fini, .get_node = nouveau_vram_manager_new, - .put_node = nouveau_vram_manager_del, + .put_node = nouveau_manager_del, .debug = nouveau_manager_debug, }; @@ -121,7 +112,6 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, if (ret) return ret; - mem->_mem = &mem->__mem; reg->start = 0; return 0; } @@ -143,7 +133,6 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_drm *drm = nvbo->cli->drm; struct nouveau_mem *mem; - struct nvkm_mmu *mmu = nvxx_mmu(&drm->client.device); int ret; ret = nouveau_mem_new(&drm->master, nvbo->kind, nvbo->comp, reg); @@ -151,8 +140,8 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, if (ret) return ret; - ret = nvkm_vm_get(mmu->vmm, reg->num_pages << 12, 12, - NV_MEM_ACCESS_RW, &mem->vma[0]); + ret = nvif_vmm_get(&mem->cli->vmm.vmm, PTES, false, 12, 0, + reg->num_pages << PAGE_SHIFT, &mem->vma[0]); if (ret) { nouveau_mem_del(reg); if (ret == -ENOSPC) { @@ -162,7 +151,6 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, return ret; } - mem->_mem = &mem->__mem; reg->start = mem->vma[0].addr >> PAGE_SHIFT; return 0; } |