anv/utrace: avoid memseting timestamp buffers by using tracepoint flags
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Using the flag we can deduce how the timestamp was written and avoid
guessing when reading back.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13806
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37111>
This commit is contained in:
Lionel Landwerlin 2025-08-30 01:55:44 +03:00 committed by Marge Bot
parent f262865a90
commit 0e198f796c

View file

@ -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 {