mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 05:20:09 +01:00
radv: add debug flags to zero vram allocations.
We are seeing apps that sometimes rely on Windows behaviour, add a flag to rule out vram zeroing. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
6eade342eb
commit
310fca375c
5 changed files with 7 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ enum {
|
|||
RADV_DEBUG_NO_IBS = 0x200,
|
||||
RADV_DEBUG_DUMP_SPIRV = 0x400,
|
||||
RADV_DEBUG_VM_FAULTS = 0x800,
|
||||
RADV_DEBUG_ZERO_VRAM = 0x1000,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
|
|
@ -412,6 +412,7 @@ static const struct debug_control radv_debug_options[] = {
|
|||
{"noibs", RADV_DEBUG_NO_IBS},
|
||||
{"spirv", RADV_DEBUG_DUMP_SPIRV},
|
||||
{"vmfaults", RADV_DEBUG_VM_FAULTS},
|
||||
{"zerovram", RADV_DEBUG_ZERO_VRAM},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -331,6 +331,9 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
|
|||
if (flags & RADEON_FLAG_GTT_WC)
|
||||
request.flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC;
|
||||
|
||||
/* 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;
|
||||
r = amdgpu_bo_alloc(ws->dev, &request, &buf_handle);
|
||||
if (r) {
|
||||
fprintf(stderr, "amdgpu: Failed to allocate a buffer:\n");
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags)
|
|||
if (debug_flags & RADV_DEBUG_NO_IBS)
|
||||
ws->use_ib_bos = false;
|
||||
|
||||
ws->zero_all_vram_allocs = debug_flags & RADV_DEBUG_ZERO_VRAM;
|
||||
ws->batchchain = !(perftest_flags & RADV_PERFTEST_NO_BATCHCHAIN);
|
||||
LIST_INITHEAD(&ws->global_bo_list);
|
||||
pthread_mutex_init(&ws->global_bo_list_lock, NULL);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ struct radv_amdgpu_winsys {
|
|||
bool debug_all_bos;
|
||||
bool batchchain;
|
||||
bool use_ib_bos;
|
||||
bool zero_all_vram_allocs;
|
||||
unsigned num_buffers;
|
||||
|
||||
pthread_mutex_t global_bo_list_lock;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue