drm/amdkfd: Alloc memory of GPU support memory partition
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 26 Jan 2023 23:50:09 +0000 (18:50 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 14:00:03 +0000 (10:00 -0400)
commit53c5692e7a3c8e8eed3ec6b876a3c982d217a5d7
tree56ba5b944d2c2c6673ed891bd10140c16c6da822
parentf24e924b7e8aba7b62671e7e1a19d83301a08597
drm/amdkfd: Alloc memory of GPU support memory partition

For dGPU mode VRAM allocation, create amdgpu_bo from amdgpu_vm->mem_id,
to alloc from the correct memory range.

For APU mode VRAM allocation, set alloc domain to GTT, and set
bp->mem_id_plus1 from amdgpu_vm->mem_id + 1 to create amdgpu_bo, to
allocate system memory from correct NUMA node.

For GTT allocation, use mem_id -1 to allocate system memory from any
NUMA nodes.

Remove amdgpu_ttm_tt_set_mem_pool, to avoid the confusion that memory
maybe allocated from different mem_id.

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_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h