Module: Mesa
Branch: master
Commit: 8f8c28767ed6c286b4cc05aa3fd11459c3c57f66
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f8c28767ed6c286b4cc05aa3fd11459c3c57f66

Author: Marek Olšák <[email protected]>
Date:   Tue Jul 30 18:40:22 2019 -0400

radeonsi/gfx10: implement a bug workaround for NGG -> legacy transitions

Reviewed-by: Samuel Pitoiset <[email protected]>
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>

---

 src/gallium/drivers/radeonsi/si_state_draw.c    |  8 ++++++--
 src/gallium/drivers/radeonsi/si_state_shaders.c | 10 ++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index 62b00b5a3c4..8254d7ba2a3 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -1106,10 +1106,14 @@ void gfx10_emit_cache_flush(struct si_context *ctx)
        }
 
        /* We don't need these. */
-       assert(!(flags & (SI_CONTEXT_VGT_FLUSH |
-                         SI_CONTEXT_VGT_STREAMOUT_SYNC |
+       assert(!(flags & (SI_CONTEXT_VGT_STREAMOUT_SYNC |
                          SI_CONTEXT_FLUSH_AND_INV_DB_META)));
 
+       if (flags & SI_CONTEXT_VGT_FLUSH) {
+               radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
+               radeon_emit(cs, EVENT_TYPE(V_028A90_VGT_FLUSH) | 
EVENT_INDEX(0));
+       }
+
        if (flags & SI_CONTEXT_FLUSH_AND_INV_CB)
                ctx->num_cb_cache_flushes++;
        if (flags & SI_CONTEXT_FLUSH_AND_INV_DB)
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index eb73834e412..a0bb0a458d6 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -3022,6 +3022,16 @@ static bool si_update_ngg(struct si_context *sctx)
                new_ngg = false;
 
        if (new_ngg != sctx->ngg) {
+               /* Transitioning from NGG to legacy GS requires VGT_FLUSH on 
Navi10-14.
+                * VGT_FLUSH is also emitted at the beginning of IBs when 
legacy GS ring
+                * pointers are set.
+                */
+               if ((sctx->family == CHIP_NAVI10 ||
+                    sctx->family == CHIP_NAVI12 ||
+                    sctx->family == CHIP_NAVI14) &&
+                   !new_ngg)
+                       sctx->flags |= SI_CONTEXT_VGT_FLUSH;
+
                sctx->ngg = new_ngg;
                sctx->last_rast_prim = -1; /* reset this so that it gets 
updated */
                return true;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to