From 5f8daae4d829c9f734d2f41058990809d2dba349 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 7 Jan 2020 15:57:10 +0100 Subject: [PATCH] radeonsi: check ctx->sdma_cs before using it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit e5167a9276de1f383888714b41d3a9be2b9c1da9 disabled SDMA for gfx8. This caused 3 piglit arb_sparse_buffer tests (basic, buffer-data and commit) to crash on GFX8. Reported-by: Michel Dänzer Reviewed-by: Marek Olšák Fixes: e5167a9276d ("radeonsi: disable SDMA on gfx8 to fix corruption on RX 580") --- src/gallium/drivers/radeonsi/si_buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 1de431cc937..38d8e9456c2 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -797,7 +797,8 @@ static bool si_resource_commit(struct pipe_context *pctx, si_flush_dma_cs(ctx, PIPE_FLUSH_ASYNC, NULL); } - ctx->ws->cs_sync_flush(ctx->sdma_cs); + if (ctx->sdma_cs) + ctx->ws->cs_sync_flush(ctx->sdma_cs); ctx->ws->cs_sync_flush(ctx->gfx_cs); assert(resource->target == PIPE_BUFFER); -- 2.30.2