OSDN Git Service

drm/amdgpu: Add memory partition mem_id to amdgpu_bo
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 26 Jan 2023 23:25:28 +0000 (18:25 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 14:00:00 +0000 (10:00 -0400)
commitf24e924b7e8aba7b62671e7e1a19d83301a08597
tree44f1fbfb946e168df782376dd576955eb08d6e92
parent4c6ce75fdd628c43aea11448ed41b52119dae42b
drm/amdgpu: Add memory partition mem_id to amdgpu_bo

Add mem_id_plus1 parameter to amdgpu_gem_object_create and pass it to
amdgpu_bo_create. For dGPU mode allocation, mem_id is used by VRAM
manager to get the memory partition fpfn, lpfn from xcp manager. For APU
native mode allocation, mem_id is used to get NUMA node id from xcp
manager, then pass to TTM as numa pool id to alloc memory from the
specific NUMA node. mem_id -1 means for entire VRAM or any NUMA nodes.

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h