radv: Use correct alignment for SQTT buffer sizes.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 28 Sep 2020 01:50:49 +0000 (03:50 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 28 Sep 2020 15:46:08 +0000 (15:46 +0000)
Otherwise we can miss the start of the buffer, which
results in RGP missing the initial (and only) timestamp
packet and results in RGP completely ignoring the second
SE, causing messy issues and missed events.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6550>

src/amd/vulkan/radv_sqtt.c

index da18ce6..a1de66e 100644 (file)
@@ -496,6 +496,12 @@ radv_thread_trace_init_bo(struct radv_device *device)
        struct radeon_winsys *ws = device->ws;
        uint64_t size;
 
+       /* The buffer size and address need to be aligned in HW regs. Align the
+        * size as early as possible so that we do all the allocation & addressing
+        * correctly. */
+       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 radv_thread_trace_info) * 4,
                       1 << SQTT_BUFFER_ALIGN_SHIFT);