Revert "radv: do not overallocate the SQTT buffer"
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Feb 2021 14:23:33 +0000 (15:23 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 1 Mar 2021 12:09:15 +0000 (13:09 +0100)
This fixes computing the thread trace data offset.

This reverts commit c7e6f4ff3da39f36fdda8f0ec6eea4925cd3afdc.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9307>

src/amd/vulkan/radv_sqtt.c

index 88be1c7..ed7e5df 100644 (file)
@@ -400,7 +400,6 @@ radv_emit_wait_for_idle(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;
 
@@ -410,10 +409,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 all SEs. */
-       size = align64(sizeof(struct ac_thread_trace_info) * max_se,
+       /* Compute total size of the thread trace BO for 4 SEs. */
+       size = align64(sizeof(struct ac_thread_trace_info) * 4,
                       1 << SQTT_BUFFER_ALIGN_SHIFT);
-       size += device->thread_trace.buffer_size * max_se;
+       size += device->thread_trace.buffer_size * 4ll;
 
        device->thread_trace.bo = ws->buffer_create(ws, size, 4096,
                                                    RADEON_DOMAIN_VRAM,