Mesa (main): radeonsi: set scratch_state dirty only if ctx->scratch_buffer allocated

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 16 23:21:51 UTC 2021


Module: Mesa
Branch: main
Commit: 7f9b3a70986b66a799145b461af4df74652078b7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f9b3a70986b66a799145b461af4df74652078b7

Author: Yogesh mohan marimuthu <yogesh.mohanmarimuthu at amd.com>
Date:   Tue Jun 15 15:01:33 2021 +0530

radeonsi: set scratch_state dirty only if ctx->scratch_buffer allocated

if ctx->scratch_buffer is NULL, then no need to update SPI_TMPRING_SIZE
size register.

Signed-off-by: Yogesh mohan marimuthu <yogesh.mohanmarimuthu at amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11900>

---

 src/gallium/drivers/radeonsi/si_gfx_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c
index 8ecd92f247c..1e001989c02 100644
--- a/src/gallium/drivers/radeonsi/si_gfx_cs.c
+++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c
@@ -557,9 +557,9 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs)
       memset(ctx->tracked_regs.spi_ps_input_cntl, 0xff, sizeof(uint32_t) * 32);
    }
 
-   si_mark_atom_dirty(ctx, &ctx->atoms.s.scratch_state);
    if (ctx->scratch_buffer) {
       si_context_add_resource_size(ctx, &ctx->scratch_buffer->b.b);
+      si_mark_atom_dirty(ctx, &ctx->atoms.s.scratch_state);
    }
 
    if (ctx->streamout.suspended) {



More information about the mesa-commit mailing list