diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2021-02-10 14:27:24 +0100 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-02-11 09:29:31 +0000 |
commit | c7e6f4ff3da39f36fdda8f0ec6eea4925cd3afdc (patch) | |
tree | d667d94642160cfce1a59e8d9a361c18965219d3 /src/amd/vulkan/radv_sqtt.c | |
parent | 72709c2bcef02001d5cba1c56b6acf27acedbf67 (diff) |
radv: do not overallocate the SQTT buffer
The total size is computed for all available SEs which is not always 4.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8960>
Diffstat (limited to 'src/amd/vulkan/radv_sqtt.c')
-rw-r--r-- | src/amd/vulkan/radv_sqtt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_sqtt.c b/src/amd/vulkan/radv_sqtt.c index 4f1c5bca4ff..e44e7c7f6d4 100644 --- a/src/amd/vulkan/radv_sqtt.c +++ b/src/amd/vulkan/radv_sqtt.c @@ -493,6 +493,7 @@ radv_thread_trace_init_cs(struct radv_device *device) static bool radv_thread_trace_init_bo(struct radv_device *device) { + unsigned max_se = device->physical_device->rad_info.max_se; struct radeon_winsys *ws = device->ws; uint64_t size; @@ -502,10 +503,10 @@ radv_thread_trace_init_bo(struct radv_device *device) device->thread_trace.buffer_size = align64(device->thread_trace.buffer_size, 1u << SQTT_BUFFER_ALIGN_SHIFT); - /* Compute total size of the thread trace BO for 4 SEs. */ - size = align64(sizeof(struct ac_thread_trace_info) * 4, + /* Compute total size of the thread trace BO for all SEs. */ + size = align64(sizeof(struct ac_thread_trace_info) * max_se, 1 << SQTT_BUFFER_ALIGN_SHIFT); - size += device->thread_trace.buffer_size * 4ll; + size += device->thread_trace.buffer_size * max_se; device->thread_trace.bo = ws->buffer_create(ws, size, 4096, RADEON_DOMAIN_VRAM, |