radeonsi: use TC write-back instead of full cache invalidation
authorMarek Olšák <marek.olsak@amd.com>
Mon, 10 Oct 2016 16:51:24 +0000 (18:51 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 12 Oct 2016 16:29:40 +0000 (18:29 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_draw.c

index 632839ff3a57a4f32d534638f0b7679183aea7b0..e78510619c1901a94f6e6b1ad57a44cb55ba8f92 100644 (file)
@@ -701,7 +701,7 @@ static void si_launch_grid(
 
                /* The hw doesn't read the indirect buffer via TC L2. */
                if (r600_resource(info->indirect)->TC_L2_dirty) {
-                       sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+                       sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
                        r600_resource(info->indirect)->TC_L2_dirty = false;
                }
        }
index 34f3ed7264b982584e3c94dc301a275ab4c5b444..ad65fc22f60c69c8c9d3ff2952526b2e224dd0e7 100644 (file)
@@ -3397,21 +3397,15 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
                 * L1 isn't used.
                 */
                if (sctx->screen->b.chip_class <= CIK)
-                       sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+                       sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
        }
 
        if (flags & PIPE_BARRIER_FRAMEBUFFER)
                sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER;
 
        if (flags & (PIPE_BARRIER_FRAMEBUFFER |
-                    PIPE_BARRIER_INDIRECT_BUFFER)) {
-               /* Not sure if INV_GLOBAL_L2 is the best thing here.
-                *
-                * We need to make sure that TC L1 & L2 are written back to
-                * memory, because CB fetches don't consider TC, but there's
-                * no need to invalidate any TC cache lines. */
-               sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
-       }
+                    PIPE_BARRIER_INDIRECT_BUFFER))
+               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
 }
 
 static void *si_create_blend_custom(struct si_context *sctx, unsigned mode)
index 33b6b232343d5595eb5dd7a25d603ba081673ffd..c14e852bec25501f49c18d6f6070f5a31d372197 100644 (file)
@@ -1047,18 +1047,18 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
        /* VI reads index buffers through TC L2. */
        if (info->indexed && sctx->b.chip_class <= CIK &&
            r600_resource(ib.buffer)->TC_L2_dirty) {
-               sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
                r600_resource(ib.buffer)->TC_L2_dirty = false;
        }
 
        if (info->indirect && r600_resource(info->indirect)->TC_L2_dirty) {
-               sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
                r600_resource(info->indirect)->TC_L2_dirty = false;
        }
 
        if (info->indirect_params &&
            r600_resource(info->indirect_params)->TC_L2_dirty) {
-               sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
                r600_resource(info->indirect_params)->TC_L2_dirty = false;
        }