From 5da4941101dca8b476dc7b2efb21119cab3fb90d Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 17 Jun 2025 13:49:44 +0200 Subject: [PATCH] radeonsi: fix typo in sdma code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cs_create returns a bool not an int so check correctly for success (sdma was still used because sdma_cs would be non NULL when entering this function the second time). While at it update debug_flags to not retry creating sdma_cs if it failed. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_sdma_copy_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_sdma_copy_image.c b/src/gallium/drivers/radeonsi/si_sdma_copy_image.c index fd719f59733..ef1f5c25709 100644 --- a/src/gallium/drivers/radeonsi/si_sdma_copy_image.c +++ b/src/gallium/drivers/radeonsi/si_sdma_copy_image.c @@ -405,8 +405,10 @@ bool si_sdma_copy_image(struct si_context *sctx, struct si_texture *dst, struct return false; sctx->sdma_cs = CALLOC_STRUCT(radeon_cmdbuf); - if (ws->cs_create(sctx->sdma_cs, sctx->ctx, AMD_IP_SDMA, NULL, NULL)) + if (!ws->cs_create(sctx->sdma_cs, sctx->ctx, AMD_IP_SDMA, NULL, NULL)) { + sctx->screen->debug_flags |= DBG(NO_DMA); return false; + } } if (!si_prepare_for_sdma_copy(sctx, dst, src))