From 0a416fb949eb28dd128ec6faedf474ab313d5d26 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 18 Nov 2025 12:00:17 +0100 Subject: [PATCH] radeonsi/sqtt: clear out sqtt bo on resize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the resizing fails, we shouldn't use the destroyed bo anymore. Fixes: 5794a86f191 ("radeonsi/sqtt: support sqtt buffer auto-resizing") Reviewed-by: Marek Olšák Part-of: (cherry picked from commit bac9d17ead01467258e706973fdf193b9da26062) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_sqtt.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e5d486613f6..7048ab0f03b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4614,7 +4614,7 @@ "description": "radeonsi/sqtt: clear out sqtt bo on resize", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5794a86f1918919435a85be07c58010fb8578a6d", "notes": null diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c b/src/gallium/drivers/radeonsi/si_sqtt.c index 3a7fa7955ef..da5fb0422de 100644 --- a/src/gallium/drivers/radeonsi/si_sqtt.c +++ b/src/gallium/drivers/radeonsi/si_sqtt.c @@ -264,6 +264,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; /* Double the size of the thread trace buffer per SE. */ sctx->sqtt->buffer_size *= 2; @@ -490,7 +491,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) { mesa_loge("Failed to read the trace"); if (!sctx->sqtt->trigger_file) { sctx->sqtt->start_frame = num_frames + 10;