drm/amdgpu: Support contiguous VRAM allocation
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 5 Apr 2024 19:46:50 +0000 (15:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:44:46 +0000 (09:44 -0400)
commit155ce502e9adf9001d6fa35ca85843b7f0e538c7
tree6df6d718730cee11eac82044a160c90c8b5d6fa3
parentc0d6bd3cd209419cc46ac49562bef1db65d90e70
drm/amdgpu: Support contiguous VRAM allocation

RDMA device with limited scatter-gather ability requires contiguous VRAM
buffer allocation for RDMA peer direct support.

Add a new KFD alloc memory flag and store as bo alloc flag
AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS. When pin this bo to export for RDMA
peerdirect access, this will set TTM_PL_FLAG_CONTIFUOUS flag, and ask
VRAM buddy allocator to get contiguous VRAM.

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
include/uapi/linux/kfd_ioctl.h