]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu: Handle sg size limit for contiguous allocation
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 19 Apr 2024 20:27:00 +0000 (16:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:58:08 +0000 (09:58 -0400)
commitb2dba064c9bdd18c7dd39066d25453af28451dbf
tree967ad85e697f5a8404d41a53f41fda38c4552259
parentfbbbf6fb3f7c29c0d18cdb8e6217570cdc97961f
drm/amdgpu: Handle sg size limit for contiguous allocation

Define macro AMDGPU_MAX_SG_SEGMENT_SIZE 2GB, because struct scatterlist
length is unsigned int, and some users of it cast to a signed int, so
every segment of sg table is limited to size 2GB maximum.

For contiguous VRAM allocation, don't limit the max buddy block size in
order to get contiguous VRAM memory. To workaround the sg table segment
size limit, allocate multiple segments if contiguous size is bigger than
AMDGPU_MAX_SG_SEGMENT_SIZE.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c