From: Philip Yang Date: Tue, 7 Mar 2023 16:30:24 +0000 (-0500) Subject: drm/amdgpu: dGPU mode set VRAM range lpfn as exclusive X-Git-Tag: v6.6.17~4420^2~12^2~315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 85ad355..b2d11c4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -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;