aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/winsys
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-02-20 07:19:27 +0100
committerSamuel Pitoiset <[email protected]>2020-02-20 18:47:29 +0100
commit37650bf93803822d6e3aefae7c2f4c7eef5d6171 (patch)
tree24fa5e3c953d8cd1ab7567677717e1d908972713 /src/amd/vulkan/winsys
parent7a73446c513e2218a08ae9425a1bea49c63080a7 (diff)
radv/winsys: add a new flag that requests zerovram allocations
This introduces RADON_FLAG_ZERO_VRAM. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3888>
Diffstat (limited to 'src/amd/vulkan/winsys')
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
index 9e19b7b1f89..c07641d6ab8 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
@@ -382,8 +382,11 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
}
/* this won't do anything on pre 4.9 kernels */
- if (ws->zero_all_vram_allocs && (initial_domain & RADEON_DOMAIN_VRAM))
- request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+ if (initial_domain & RADEON_DOMAIN_VRAM) {
+ if (ws->zero_all_vram_allocs || (flags & RADEON_FLAG_ZERO_VRAM))
+ request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+ }
+
r = amdgpu_bo_alloc(ws->dev, &request, &buf_handle);
if (r) {
fprintf(stderr, "amdgpu: Failed to allocate a buffer:\n");