]> Git Repo - linux.git/commitdiff
drm/amdgpu: dGPU mode set VRAM range lpfn as exclusive
authorPhilip Yang <[email protected]>
Tue, 7 Mar 2023 16:30:24 +0000 (11:30 -0500)
committerAlex Deucher <[email protected]>
Fri, 9 Jun 2023 14:36:35 +0000 (10:36 -0400)
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 <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 85ad355815fe6e41f58d953223fecb8e95cfe24e..b2d11c4f39b07f8965b8f2a5b6c11ce3cfe4d011 100644 (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;
This page took 0.059919 seconds and 4 git commands to generate.