radeonsi/sqtt: clear out sqtt bo on resize
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

If the resizing fails, we shouldn't use the destroyed bo anymore.

Fixes: 5794a86f19 ("radeonsi/sqtt: support sqtt buffer auto-resizing")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38529>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-11-18 12:00:17 +01:00 committed by Marge Bot
parent 9e76f5f2a2
commit bac9d17ead

View file

@ -253,6 +253,7 @@ si_sqtt_resize_bo(struct si_context *sctx)
/* Destroy the previous thread trace BO. */
struct pb_buffer_lean *bo = sctx->sqtt->bo;
radeon_bo_reference(sctx->screen->ws, &bo, NULL);
sctx->sqtt->bo = NULL;
if (sctx->sqtt->buffer_size < UINT32_MAX / 2) {
/* Double the size of the thread trace buffer per SE. */
@ -488,7 +489,7 @@ void si_handle_sqtt(struct si_context *sctx, struct radeon_cmdbuf *rcs)
if (sctx->spm.ptr)
sctx->ws->buffer_unmap(sctx->ws, sctx->spm.bo);
} else {
} else if (sctx->sqtt->bo) {
if (!sctx->sqtt->trigger_file) {
sctx->sqtt->start_frame = num_frames + 10;
}