summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-11-26 03:28:05 +0100
committerJuan A. Suarez Romero <[email protected]>2018-11-30 10:29:35 +0100
commitc14ed4944532ad8cc24f798bcdbac67aee4bc3a6 (patch)
treec698eb17a1f18affaaa5751a524f5a1b627625a1 /src/amd
parentcfd1f8b92cae9dde3e5bed42109b5142f50a2ee5 (diff)
radv: Align large buffers to the fragment size.
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" v2: Do not impact the alignment of the physical memory. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> CC: <[email protected]> (cherry picked from commit 6569644bb6e1f58fd739d83bd4dc42e6af6b6097)
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
index 25764d93f6a..482cf0f6659 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
@@ -304,8 +304,12 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
return NULL;
}
+ unsigned virt_alignment = alignment;
+ if (size >= ws->info.pte_fragment_size)
+ virt_alignment = MAX2(virt_alignment, ws->info.pte_fragment_size);
+
r = amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
- size, alignment, 0, &va, &va_handle,
+ size, virt_alignment, 0, &va, &va_handle,
(flags & RADEON_FLAG_32BIT ? AMDGPU_VA_RANGE_32_BIT : 0) |
AMDGPU_VA_RANGE_HIGH);
if (r)