mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
This commit is contained in:
committed by
Alex Deucher
parent
6cfba94a77
commit
3ebfd221c1
@@ -1051,6 +1051,7 @@ static void amdgpu_ttm_backend_destroy(struct ttm_device *bdev,
|
||||
static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
|
||||
uint32_t page_flags)
|
||||
{
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
||||
struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo);
|
||||
struct amdgpu_ttm_tt *gtt;
|
||||
enum ttm_caching caching;
|
||||
@@ -1060,7 +1061,10 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
|
||||
return NULL;
|
||||
}
|
||||
gtt->gobj = &bo->base;
|
||||
gtt->pool_id = abo->mem_id;
|
||||
if (adev->gmc.mem_partitions && abo->xcp_id >= 0)
|
||||
gtt->pool_id = KFD_XCP_MEM_ID(adev, abo->xcp_id);
|
||||
else
|
||||
gtt->pool_id = abo->xcp_id;
|
||||
|
||||
if (abo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
|
||||
caching = ttm_write_combined;
|
||||
|
||||
Reference in New Issue
Block a user