summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2023-03-08 19:57:00 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 17:36:38 +0300
commit3ebfd221c1a83e5f0edadb87d173d8fd93d1d125 (patch)
treeac81bd8c25170d61d01a2627fe14f72ac38fda28 /drivers/gpu/drm/amd/amdkfd/kfd_svm.c
parent6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6 (diff)
downloadlinux-3ebfd221c1a83e5f0edadb87d173d8fd93d1d125.tar.xz
drm/amdkfd: Store xcp partition id to amdgpu bo
For memory accounting per compute partition and export drm amdgpu bo and then import to KFD, we need the xcp id to account the memory usage or find the KFD node of the original amdgpu bo to create the KFD bo on the correct adev KFD node. Set xcp_id_plus1 of amdgpu_bo_param to create bo and store xcp_id to amddgpu bo. Add helper macro to get the mem_id from adev and xcp_id. v2: squash in fix ("drm/amdgpu: Fix BO creation failure on GFX 9.4.3 dGPU") Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_svm.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_svm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index a700d9ccd054..45959892bc0f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -556,7 +556,7 @@ svm_range_vram_node_new(struct kfd_node *node, struct svm_range *prange,
bp.type = ttm_bo_type_device;
bp.resv = NULL;
if (node->xcp)
- bp.mem_id_plus1 = node->xcp->mem_id + 1;
+ bp.xcp_id_plus1 = node->xcp->id + 1;
r = amdgpu_bo_create_user(node->adev, &bp, &ubo);
if (r) {
@@ -567,7 +567,7 @@ svm_range_vram_node_new(struct kfd_node *node, struct svm_range *prange,
pr_debug("alloc bo at offset 0x%lx size 0x%lx on partition %d\n",
bo->tbo.resource->start << PAGE_SHIFT, bp.size,
- bp.mem_id_plus1 - 1);
+ bp.xcp_id_plus1 - 1);
r = amdgpu_bo_reserve(bo, true);
if (r) {