r600: do SQ flush ES ring rolling workaround
authorDave Airlie <airlied@redhat.com>
Mon, 23 Feb 2015 20:14:31 +0000 (20:14 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Dec 2015 22:24:32 +0000 (08:24 +1000)
Need to insert a SQ_NON_EVENT when ever geometry
shaders are enabled.

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
src/gallium/drivers/r600/r600d.h

index bbb55adef827ca46bccc92901e3c12ab128bcba5..71a435f87095a58e897751063ba571d5e5672efa 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                47
+#define R600_MAX_DRAW_CS_DWORDS                49
 #define R600_TRACE_CS_DWORDS           7
 
 #define R600_MAX_USER_CONST_BUFFERS 13
index 4ea122a1136caa84a3202638dea56ce383d82ffa..82430e549c76597d0bb5b66555ef8e0cf5b41c54 100644 (file)
@@ -1769,6 +1769,12 @@ 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);
        }
 
+       /* ES ring rolling over at EOP - workaround */
+       if (rctx->b.chip_class == R600) {
+               cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
+               cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_SQ_NON_EVENT);
+       }
+
        if (rctx->screen->b.trace_bo) {
                r600_trace_emit(rctx);
        }
index d4df0606e56ff39706c41823f45027d573224915..3d223edb5f4f6bc54a0edc646d62e973b5b68333 100644 (file)
 #define EVENT_TYPE_SAMPLE_STREAMOUTSTATS       0x20
 #define EVENT_TYPE_FLUSH_AND_INV_DB_META       0x2c /* supported on r700+ */
 #define EVENT_TYPE_VGT_FLUSH                   0x24
+#define EVENT_TYPE_SQ_NON_EVENT                0x26
 #define EVENT_TYPE_FLUSH_AND_INV_CB_META       46 /* supported on r700+ */
 #define                EVENT_TYPE(x)                           ((x) << 0)
 #define                EVENT_INDEX(x)                          ((x) << 8)