etnaviv: Flush TS cache before changing TS configuration
authorWladimir J. van der Laan <laanwj@gmail.com>
Tue, 14 Nov 2017 09:21:22 +0000 (10:21 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 15 Nov 2017 22:27:39 +0000 (23:27 +0100)
This is to make sure that the TS is properly flushed to memory before
rendering to a new surface starts.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_emit.c

index d313af60cf4f5c445d3e91a5d30016a68addde10..b6b06e3c1fa2607ace79cc7200c70d9989fbc71b 100644 (file)
@@ -322,6 +322,11 @@ etna_emit_state(struct etna_context *ctx)
       etna_stall(stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE);
    }
 
+   /* Flush TS cache before changing TS configuration. */
+   if (unlikely(dirty & ETNA_DIRTY_TS)) {
+      etna_set_state(stream, VIVS_TS_FLUSH_CACHE, VIVS_TS_FLUSH_CACHE_FLUSH);
+   }
+
    /* If MULTI_SAMPLE_CONFIG.MSAA_SAMPLES changed, clobber affected shader
     * state to make sure it is always rewritten. */
    if (unlikely(dirty & (ETNA_DIRTY_FRAMEBUFFER))) {