Mesa (staging/20.3): radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 19 18:46:59 UTC 2020


Module: Mesa
Branch: staging/20.3
Commit: cd3cd16783830ef4b615e6f8b7086ac0ef9b0b93
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd3cd16783830ef4b615e6f8b7086ac0ef9b0b93

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Oct 16 11:37:16 2020 -0400

radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch

Fixes: 3da91b3327f - radeonsi/ngg: add VGT_FLUSH when enabling fast launch

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
(cherry picked from commit 8d2876a34314e7378eff67a5f320eba56683dba3)

---

 .pick_status.json                            | 2 +-
 src/gallium/drivers/radeonsi/si_gfx_cs.c     | 4 ++++
 src/gallium/drivers/radeonsi/si_state_draw.c | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7cd032cdfc1..6cf601f71b0 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -697,7 +697,7 @@
         "description": "radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "3da91b3327fb93d0364c0ca9d0216f695160831d"
     },
diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c
index 75986169d9a..436a1116360 100644
--- a/src/gallium/drivers/radeonsi/si_gfx_cs.c
+++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c
@@ -424,6 +424,10 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs)
    ctx->flags |= SI_CONTEXT_INV_ICACHE | SI_CONTEXT_INV_SCACHE | SI_CONTEXT_INV_VCACHE |
                  SI_CONTEXT_INV_L2 | SI_CONTEXT_START_PIPELINE_STATS;
 
+   /* We don't know if the last draw call used GS fast launch, so assume it didn't. */
+   if (ctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
+      ctx->flags |= SI_CONTEXT_VGT_FLUSH;
+
    radeon_add_to_buffer_list(ctx, ctx->gfx_cs, ctx->border_color_buffer,
                              RADEON_USAGE_READ, RADEON_PRIO_BORDER_COLORS);
    if (ctx->shadowed_regs) {
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index ff69f2c62d5..872ce0a2ee7 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -2071,7 +2071,8 @@ static void si_multi_draw_vbo(struct pipe_context *ctx,
          /* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
           * See issues #2418, #2426, #2434
           */
-         if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
+         if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL &&
+             !(sctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL))
             sctx->flags |= SI_CONTEXT_VGT_FLUSH;
          sctx->ngg_culling = ngg_culling;
          sctx->do_update_shaders = true;



More information about the mesa-commit mailing list