aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_mem.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-04-30 09:48:27 +0200
committerChristian König <christian.koenig@amd.com>2021-06-04 15:16:46 +0200
commitcb1c81467af355829a4a9d8fa3f92ffab355d93c (patch)
tree3d24d197d2b3000d457198f733607e73d4b96685 /drivers/gpu/drm/nouveau/nouveau_mem.h
parentdrm/vmwgfx: switch the TTM backends to self alloc (diff)
downloadlinux-dev-cb1c81467af355829a4a9d8fa3f92ffab355d93c.tar.xz
linux-dev-cb1c81467af355829a4a9d8fa3f92ffab355d93c.zip
drm/ttm: flip the switch for driver allocated resources v2
Instead of both driver and TTM allocating memory finalize embedding the ttm_resource object as base into the driver backends. v2: fix typo in vmwgfx grid mgr and double init in amdgpu_vram_mgr.c 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-10-christian.koenig@amd.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_mem.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.h b/drivers/gpu/drm/nouveau/nouveau_mem.h
index 3a6a1be2ed52..2c01166a90f2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.h
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.h
@@ -6,12 +6,6 @@ struct ttm_tt;
#include <nvif/mem.h>
#include <nvif/vmm.h>
-static inline struct nouveau_mem *
-nouveau_mem(struct ttm_resource *reg)
-{
- return reg->mm_node;
-}
-
struct nouveau_mem {
struct ttm_resource base;
struct nouveau_cli *cli;
@@ -21,8 +15,14 @@ struct nouveau_mem {
struct nvif_vma vma[2];
};
+static inline struct nouveau_mem *
+nouveau_mem(struct ttm_resource *reg)
+{
+ return container_of(reg, struct nouveau_mem, base);
+}
+
int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
- struct ttm_resource *);
+ struct ttm_resource **);
void nouveau_mem_del(struct ttm_resource *);
int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);