summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_sys_manager.c
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/ttm/ttm_sys_manager.c
parentd3bcb4b02fe977d6b7a82dbb6288e9223b5b6732 (diff)
downloadlinux-stable-cb1c81467af355829a4a9d8fa3f92ffab355d93c.tar.gz
linux-stable-cb1c81467af355829a4a9d8fa3f92ffab355d93c.tar.bz2
linux-stable-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/ttm/ttm_sys_manager.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_sys_manager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c b/drivers/gpu/drm/ttm/ttm_sys_manager.c
index 2b75f493c3c9..63aca52f75e1 100644
--- a/drivers/gpu/drm/ttm/ttm_sys_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_sys_manager.c
@@ -10,20 +10,20 @@
static int ttm_sys_man_alloc(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo,
const struct ttm_place *place,
- struct ttm_resource *mem)
+ struct ttm_resource **res)
{
- mem->mm_node = kzalloc(sizeof(*mem), GFP_KERNEL);
- if (!mem->mm_node)
+ *res = kzalloc(sizeof(**res), GFP_KERNEL);
+ if (!*res)
return -ENOMEM;
- ttm_resource_init(bo, place, mem->mm_node);
+ ttm_resource_init(bo, place, *res);
return 0;
}
static void ttm_sys_man_free(struct ttm_resource_manager *man,
- struct ttm_resource *mem)
+ struct ttm_resource *res)
{
- kfree(mem->mm_node);
+ kfree(res);
}
static const struct ttm_resource_manager_func ttm_sys_manager_func = {