summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2023-03-07 11:30:24 -0500
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 10:36:35 -0400
commit6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6 (patch)
treefec51809f0d698b9d2beaf4dd14a6ace6444526d /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentea7bf2f22061a7bd77b17ddd4ac1bb3500ae823f (diff)
downloadlinux-stable-6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6.tar.gz
linux-stable-6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6.tar.bz2
linux-stable-6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6.zip
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 85ad355815fe..b2d11c4f39b0 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;