r600: SMX returns CONTEXT_DONE early workaround
authorDave Airlie <airlied@redhat.com>
Tue, 24 Feb 2015 04:10:20 +0000 (14:10 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Dec 2015 22:25:00 +0000 (08:25 +1000)
streamout, gs rings bug on certain r600s, requires a wait idle
before each surface sync.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.6 11.0 11.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state_common.c

index 71a435f87095a58e897751063ba571d5e5672efa..c8ee612658ef87cad13258be4752f69b4044ed3a 100644 (file)
@@ -59,7 +59,7 @@
 
 /* the number of CS dwords for flushing and drawing */
 #define R600_MAX_FLUSH_CS_DWORDS       16
-#define R600_MAX_DRAW_CS_DWORDS                49
+#define R600_MAX_DRAW_CS_DWORDS                52
 #define R600_TRACE_CS_DWORDS           7
 
 #define R600_MAX_USER_CONST_BUFFERS 13
index 82430e549c76597d0bb5b66555ef8e0cf5b41c54..e50f24ec02a8d4345aceed24d82ad3d952dcc041 100644 (file)
@@ -1769,6 +1769,18 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
                                        (info.count_from_stream_output ? S_0287F0_USE_OPAQUE(1) : 0);
        }
 
+       /* SMX returns CONTEXT_DONE too early workaround */
+       if (rctx->b.family == CHIP_R600 ||
+           rctx->b.family == CHIP_RV610 ||
+           rctx->b.family == CHIP_RV630 ||
+           rctx->b.family == CHIP_RV635) {
+               /* if we have gs shader or streamout
+                  we need to do a wait idle after every draw */
+               if (rctx->gs_shader || rctx->b.streamout.streamout_enabled) {
+                       radeon_set_config_reg(cs, R_008040_WAIT_UNTIL, S_008040_WAIT_3D_IDLE(1));
+               }
+       }
+
        /* ES ring rolling over at EOP - workaround */
        if (rctx->b.chip_class == R600) {
                cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);