r600g: fix streamout cache flush for r600
authorMarek Olšák <maraeo@gmail.com>
Sun, 26 Feb 2012 16:07:52 +0000 (17:07 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 27 Feb 2012 15:21:45 +0000 (16:21 +0100)
Figured out by trial and error.

src/gallium/drivers/r600/r600_hw_context.c

index 8c2e1837ff41ae0ebe3b44f8d7d793a144c400ec..d0ef25f41194c49cc1495a19a10d6a9ef5c57366 100644 (file)
@@ -1915,13 +1915,21 @@ void r600_context_streamout_end(struct r600_context *ctx)
                r600_set_streamout_enable(ctx, 0);
        }
 
-       if (ctx->chip_class < R700) {
+       /* This is needed to fix cache flushes on r600. */
+       if (ctx->chip_class == R600) {
+               if (ctx->family == CHIP_RV670 ||
+                   ctx->family == CHIP_RS780 ||
+                   ctx->family == CHIP_RS880) {
+                       flush_flags |= S_0085F0_DEST_BASE_0_ENA(1);
+               }
+
                r600_atom_dirty(ctx, &ctx->atom_r6xx_flush_and_inv);
-       } else {
-               ctx->atom_surface_sync.flush_flags |= flush_flags;
-               r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
        }
 
+       /* Flush streamout caches. */
+       ctx->atom_surface_sync.flush_flags |= flush_flags;
+       r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+
        ctx->num_cs_dw_streamout_end = 0;
 
 #if 0