Skip to contentSkip to conversation

drm/amdgpu: remove TOPDOWN flags when allocating VRAM in large bar system

PATCH In review Shane Xiao 2 participants 2 messages Feb 15, 2023

Subsystems (2)
lore
Share & tools
lore

Shane Xiao

author
#0 lore raw

PATCH 1/1 drm/amdgpu: remove TOPDOWN flags when allocating VRAM in large bar system

Since VRAM manager is changed from drm mm to drm buddy, the TOP_DOWN flag should not be set by default in the large bar system. Removing this flag helps improve drm buddy allactor efficiency and reduce the risk of splitting higher order block into lower order.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
index 2d237f3d3a2e..1c3e647400bd 100644
@@ -139,7 +139,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 
 		if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)
 			places[c].lpfn = visible_pfn;
-		else
+		else if (adev->gmc.real_vram_size != adev->gmc.visible_vram_size)
 			places[c].flags |= TTM_PL_FLAG_TOPDOWN;
 
 		if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 15.02.23 um 06:25 schrieb Shane Xiao:

Quoted 6 lines

Since VRAM manager is changed from drm mm to drm buddy, the TOP_DOWN flag should not be set by default in the large bar system. Removing this flag helps improve drm buddy allactor efficiency and reduce the risk of splitting higher order block into lower order.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
index 2d237f3d3a2e..1c3e647400bd 100644
@@ -139,7 +139,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 
  		if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)
  			places[c].lpfn = visible_pfn;
-		else
+		else if (adev->gmc.real_vram_size != adev->gmc.visible_vram_size)
  			places[c].flags |= TTM_PL_FLAG_TOPDOWN;
 
  		if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)