aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorPhilip Yang <[email protected]>2023-01-26 23:11:29 +0000
committerAlex Deucher <[email protected]>2023-06-09 13:59:58 +0000
commit4c6ce75fdd628c43aea11448ed41b52119dae42b (patch)
tree80a1d7c7ade4d43a451e9ce4943e3b1882595e49 /drivers/gpu/drm/amd/amdgpu
parentdrm/amdgpu: Add memory partition id to amdgpu_vm (diff)
downloadkernel-4c6ce75fdd628c43aea11448ed41b52119dae42b.tar.gz
kernel-4c6ce75fdd628c43aea11448ed41b52119dae42b.zip
drm/amdkfd: Show KFD node memory partition info
Show KFD node memory partition id and size, add helper function KFD_XCP_MEMORY_SIZE to get kfd node memory size, will be used later to support memory accounting per partition. Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
index e4e1dbba060a..324cb566ca2f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
@@ -330,6 +330,11 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
uint64_t size, u32 alloc_flag);
+#define KFD_XCP_MEMORY_SIZE(n) ((n)->adev->gmc.num_mem_partitions ?\
+ (n)->adev->gmc.mem_partitions[(n)->xcp->mem_id].size /\
+ (n)->adev->xcp_mgr->num_xcp_per_mem_partition :\
+ (n)->adev->gmc.real_vram_size)
+
#if IS_ENABLED(CONFIG_HSA_AMD)
void amdgpu_amdkfd_gpuvm_init_mem_limits(void);
void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev,