[Mesa-dev] [PATCH] radv: Align large buffers to the fragment size.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Nov 26 02:31:49 UTC 2018


Improves performance in Talos by about 15% (and significant improvements
in RotR and possibly other but did not bench with final patch) on
kernel 4.19 and earlier.

On 4.20+ a similar effect comes from

433ca054949a "drm/amdgpu: try allocating VRAM as power of two"

Given the simplicity of the patch and the impact, CC to stable?
---
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
index 25764d93f6a..6d1739fe5cf 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
@@ -304,6 +304,9 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
 		return NULL;
 	}
 
+	if (size >= ws->info.pte_fragment_size)
+		alignment = MAX2(alignment, ws->info.pte_fragment_size);
+
 	r = amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
 				  size, alignment, 0, &va, &va_handle,
 				  (flags & RADEON_FLAG_32BIT ? AMDGPU_VA_RANGE_32_BIT : 0) |
-- 
2.19.2



More information about the mesa-dev mailing list