diff options
author | Christian König <christian.koenig@amd.com> | 2021-04-27 10:35:17 +0300 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-06-04 16:16:45 +0300 |
commit | db7349534275620016805123311a979a46364769 (patch) | |
tree | d2e6f766401433c1387fe3f4930a659109820e94 /drivers/gpu/drm/ttm | |
parent | 3eb7d96e94150304011d214750b45766cf62d9c9 (diff) | |
download | linux-db7349534275620016805123311a979a46364769.tar.xz |
drm/ttm: flip over the sys manager to self allocated nodes
Make sure to allocate a resource object here.
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-3-christian.koenig@amd.com
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_sys_manager.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c b/drivers/gpu/drm/ttm/ttm_sys_manager.c index 474221e863d0..2b75f493c3c9 100644 --- a/drivers/gpu/drm/ttm/ttm_sys_manager.c +++ b/drivers/gpu/drm/ttm/ttm_sys_manager.c @@ -3,6 +3,7 @@ #include <drm/ttm/ttm_resource.h> #include <drm/ttm/ttm_device.h> #include <drm/ttm/ttm_placement.h> +#include <linux/slab.h> #include "ttm_module.h" @@ -11,12 +12,18 @@ static int ttm_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource *mem) { + mem->mm_node = kzalloc(sizeof(*mem), GFP_KERNEL); + if (!mem->mm_node) + return -ENOMEM; + + ttm_resource_init(bo, place, mem->mm_node); return 0; } static void ttm_sys_man_free(struct ttm_resource_manager *man, struct ttm_resource *mem) { + kfree(mem->mm_node); } static const struct ttm_resource_manager_func ttm_sys_manager_func = { |