Skip to content

Commit 1b5447d

Browse files
Maarten Lankhorstalexdeucher
authored andcommitted
drm/amdgpu: Add cgroups implementation
Similar to xe, enable some simple management of VRAM only. Reviewed-by: Christian König <[email protected]> Co-developed-by: Maxime Ripard <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3666ed8 commit 1b5447d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <linux/dma-mapping.h>
2626
#include <drm/ttm/ttm_range_manager.h>
27+
#include <drm/drm_drv.h>
2728

2829
#include "amdgpu.h"
2930
#include "amdgpu_vm.h"
@@ -907,6 +908,9 @@ int amdgpu_vram_mgr_init(struct amdgpu_device *adev)
907908
struct ttm_resource_manager *man = &mgr->manager;
908909
int err;
909910

911+
man->cg = drmm_cgroup_register_region(adev_to_drm(adev), "vram", adev->gmc.real_vram_size);
912+
if (IS_ERR(man->cg))
913+
return PTR_ERR(man->cg);
910914
ttm_resource_manager_init(man, &adev->mman.bdev,
911915
adev->gmc.real_vram_size);
912916

0 commit comments

Comments
 (0)