From 0e198f796c3effb88e85f49a34e05cb971efeceb Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 30 Aug 2025 01:55:44 +0300 Subject: [PATCH] anv/utrace: avoid memseting timestamp buffers by using tracepoint flags Using the flag we can deduce how the timestamp was written and avoid guessing when reading back. Signed-off-by: Lionel Landwerlin Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13806 Reviewed-by: Yiwei Zhang Part-of: --- src/intel/vulkan/anv_utrace.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/intel/vulkan/anv_utrace.c b/src/intel/vulkan/anv_utrace.c index 96ed8748ad5..035014d76b4 100644 --- a/src/intel/vulkan/anv_utrace.c +++ b/src/intel/vulkan/anv_utrace.c @@ -307,13 +307,6 @@ anv_utrace_create_buffer(struct u_trace_context *utctx, uint64_t size_B) &bo); assert(result == VK_SUCCESS); - memset(bo->map, 0, bo->size); -#ifdef SUPPORT_INTEL_INTEGRATED_GPUS - if (device->physical->memory.need_flush && - anv_bo_needs_host_cache_flush(bo->alloc_flags)) - intel_flush_range(bo->map, bo->size); -#endif - return bo; } @@ -422,10 +415,10 @@ anv_utrace_read_ts(struct u_trace_context *utctx, uint64_t timestamp; - /* Detect a 16/32 bytes timestamp write */ - if (ts->gfx20_postsync_data[1] != 0 || - ts->gfx20_postsync_data[2] != 0 || - ts->gfx20_postsync_data[3] != 0) { + /* Gfx12.5+ use the COMPUTE_WALKER timestamp write which has a different + * format than a dummy 64bit timestamp. + */ + if (device->info->verx10 >= 125 && (flags & INTEL_DS_TRACEPOINT_FLAG_END_CS)) { if (device->info->ver >= 20) { timestamp = ts->gfx20_postsync_data[3]; } else {