r600g: move r6xx-specific streamout flush flagging into r600g
authorMarek Olšák <marek.olsak@amd.com>
Mon, 29 Dec 2014 12:27:46 +0000 (13:27 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jan 2015 11:06:43 +0000 (12:06 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/radeon/r600_streamout.c

index b6fa3b0ada0ad6c1fc08ec23c98f4b96ebc97017..ccc5a8b29468c3f41294d2703e22d9ded69f5ecf 100644 (file)
@@ -147,7 +147,8 @@ void r600_flush_emit(struct r600_context *rctx)
                cp_coher_cntl |= S_0085F0_FULL_CACHE_ENA(1);
        }
 
-       if (rctx->b.flags & R600_CONTEXT_FLUSH_AND_INV) {
+       if (rctx->b.flags & R600_CONTEXT_FLUSH_AND_INV ||
+           (rctx->b.chip_class == R600 && rctx->b.flags & R600_CONTEXT_STREAMOUT_FLUSH)) {
                cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
                cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT) | EVENT_INDEX(0);
        }
@@ -202,7 +203,8 @@ void r600_flush_emit(struct r600_context *rctx)
                                        S_0085F0_CB11_DEST_BASE_ENA(1);
        }
 
-       if (rctx->b.flags & R600_CONTEXT_STREAMOUT_FLUSH) {
+       if (rctx->b.chip_class >= R700 &&
+           rctx->b.flags & R600_CONTEXT_STREAMOUT_FLUSH) {
                cp_coher_cntl |= S_0085F0_SO0_DEST_BASE_ENA(1) |
                                S_0085F0_SO1_DEST_BASE_ENA(1) |
                                S_0085F0_SO2_DEST_BASE_ENA(1) |
@@ -211,7 +213,8 @@ void r600_flush_emit(struct r600_context *rctx)
        }
 
        /* Workaround for buggy flushing on some R6xx chipsets. */
-       if (rctx->b.flags & R600_CONTEXT_FLUSH_AND_INV &&
+       if ((rctx->b.flags & (R600_CONTEXT_FLUSH_AND_INV |
+                             R600_CONTEXT_STREAMOUT_FLUSH)) &&
            (rctx->b.family == CHIP_RV670 ||
             rctx->b.family == CHIP_RS780 ||
             rctx->b.family == CHIP_RS880)) {
index e2413c250eacc8bb003371e2b765a6dc33496719..c44f0f2171d9c7bec918ca694deadb25e943c4f6 100644 (file)
@@ -305,12 +305,7 @@ void r600_emit_streamout_end(struct r600_common_context *rctx)
        }
 
        rctx->streamout.begin_emitted = false;
-
-       if (rctx->chip_class >= R700) {
-               rctx->flags |= R600_CONTEXT_STREAMOUT_FLUSH;
-       } else {
-               rctx->flags |= R600_CONTEXT_FLUSH_AND_INV;
-       }
+       rctx->flags |= R600_CONTEXT_STREAMOUT_FLUSH;
 }
 
 /* STREAMOUT CONFIG DERIVED STATE