]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau: switch the TTM backends to self alloc
authorChristian König <christian.koenig@amd.com>
Mon, 26 Apr 2021 13:48:36 +0000 (15:48 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 4 Jun 2021 13:16:46 +0000 (15:16 +0200)
Similar to the TTM range manager.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210602100914.46246-8-christian.koenig@amd.com
drivers/gpu/drm/nouveau/nouveau_mem.h
drivers/gpu/drm/nouveau/nouveau_ttm.c

index 7df3848e85aaeb661defc24f66334780b4a276f7..3a6a1be2ed5263f97f770f69e7607e7f28991162 100644 (file)
@@ -13,6 +13,7 @@ nouveau_mem(struct ttm_resource *reg)
 }
 
 struct nouveau_mem {
+       struct ttm_resource base;
        struct nouveau_cli *cli;
        u8 kind;
        u8 comp;
index b08b8efeefbaf342f23dab52c096e5963b7468be..1ac2417effc02050248c6be108a35792aad2b35c 100644 (file)
@@ -58,6 +58,8 @@ nouveau_vram_manager_new(struct ttm_resource_manager *man,
        if (ret)
                return ret;
 
+       ttm_resource_init(bo, place, reg->mm_node);
+
        ret = nouveau_mem_vram(reg, nvbo->contig, nvbo->page);
        if (ret) {
                nouveau_mem_del(reg);
@@ -86,6 +88,7 @@ nouveau_gart_manager_new(struct ttm_resource_manager *man,
        if (ret)
                return ret;
 
+       ttm_resource_init(bo, place, reg->mm_node);
        reg->start = 0;
        return 0;
 }
@@ -111,6 +114,7 @@ nv04_gart_manager_new(struct ttm_resource_manager *man,
        if (ret)
                return ret;
 
+       ttm_resource_init(bo, place, reg->mm_node);
        ret = nvif_vmm_get(&mem->cli->vmm.vmm, PTES, false, 12, 0,
                           (long)reg->num_pages << PAGE_SHIFT, &mem->vma[0]);
        if (ret) {