Commit beb4c865 authored by Christian König's avatar Christian König

drm/nouveau: switch the TTM backends to self alloc

Similar to the TTM range manager.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210602100914.46246-8-christian.koenig@amd.com
parent 267501ec
...@@ -13,6 +13,7 @@ nouveau_mem(struct ttm_resource *reg) ...@@ -13,6 +13,7 @@ nouveau_mem(struct ttm_resource *reg)
} }
struct nouveau_mem { struct nouveau_mem {
struct ttm_resource base;
struct nouveau_cli *cli; struct nouveau_cli *cli;
u8 kind; u8 kind;
u8 comp; u8 comp;
......
...@@ -58,6 +58,8 @@ nouveau_vram_manager_new(struct ttm_resource_manager *man, ...@@ -58,6 +58,8 @@ nouveau_vram_manager_new(struct ttm_resource_manager *man,
if (ret) if (ret)
return ret; return ret;
ttm_resource_init(bo, place, reg->mm_node);
ret = nouveau_mem_vram(reg, nvbo->contig, nvbo->page); ret = nouveau_mem_vram(reg, nvbo->contig, nvbo->page);
if (ret) { if (ret) {
nouveau_mem_del(reg); nouveau_mem_del(reg);
...@@ -86,6 +88,7 @@ nouveau_gart_manager_new(struct ttm_resource_manager *man, ...@@ -86,6 +88,7 @@ nouveau_gart_manager_new(struct ttm_resource_manager *man,
if (ret) if (ret)
return ret; return ret;
ttm_resource_init(bo, place, reg->mm_node);
reg->start = 0; reg->start = 0;
return 0; return 0;
} }
...@@ -111,6 +114,7 @@ nv04_gart_manager_new(struct ttm_resource_manager *man, ...@@ -111,6 +114,7 @@ nv04_gart_manager_new(struct ttm_resource_manager *man,
if (ret) if (ret)
return ret; return ret;
ttm_resource_init(bo, place, reg->mm_node);
ret = nvif_vmm_get(&mem->cli->vmm.vmm, PTES, false, 12, 0, ret = nvif_vmm_get(&mem->cli->vmm.vmm, PTES, false, 12, 0,
(long)reg->num_pages << PAGE_SHIFT, &mem->vma[0]); (long)reg->num_pages << PAGE_SHIFT, &mem->vma[0]);
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