diff options
author | Christian König <christian.koenig@amd.com> | 2021-04-30 10:48:27 +0300 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-06-04 16:16:46 +0300 |
commit | cb1c81467af355829a4a9d8fa3f92ffab355d93c (patch) | |
tree | 3d24d197d2b3000d457198f733607e73d4b96685 /drivers/gpu/drm/nouveau/nouveau_mem.h | |
parent | d3bcb4b02fe977d6b7a82dbb6288e9223b5b6732 (diff) | |
download | linux-cb1c81467af355829a4a9d8fa3f92ffab355d93c.tar.xz |
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.h | 14 |
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 *); |