drm/amdgpu: dGPU mode set VRAM range lpfn as exclusive

TTM place lpfn is exclusive used as end (start + size) in drm and buddy
allocator, adev->gmc memory partition range lpfn is inclusive (start +
size - 1), should plus 1 to set TTM place lpfn.

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:
Philip Yang 2023-03-07 11:30:24 -05:00 committed by Alex Deucher
parent ea7bf2f220
commit 6cfba94a77
1 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,11 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
if (adev->gmc.mem_partitions && abo->mem_id >= 0) {
places[c].fpfn = adev->gmc.mem_partitions[abo->mem_id].range.fpfn;
places[c].lpfn = adev->gmc.mem_partitions[abo->mem_id].range.lpfn;
/*
* memory partition range lpfn is inclusive start + size - 1
* TTM place lpfn is exclusive start + size
*/
places[c].lpfn = adev->gmc.mem_partitions[abo->mem_id].range.lpfn + 1;
} else {
places[c].fpfn = 0;
places[c].lpfn = 0;