radeonsi: don't emit CS_PARTIAL_FLUSH if compute is not used
authorMarek Olšák <marek.olsak@amd.com>
Wed, 24 Aug 2016 13:32:56 +0000 (15:32 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 5 Sep 2016 16:01:15 +0000 (18:01 +0200)
for less noise in the HUD

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 17a4125122b4409fb5b0ed206eeef9cfc8ea1cdf..5041761b1cbb221cb85609e38b50b656cd75a09e 100644 (file)
@@ -512,6 +512,7 @@ static void si_launch_grid(
 
        si_ce_post_draw_synchronization(sctx);
 
+       sctx->compute_is_busy = true;
        sctx->b.num_compute_calls++;
        if (sctx->cs_shader_state.uses_scratch)
                sctx->b.num_spill_compute_calls++;
index f6535cfc8a690dd470c4a75efc3e955cf181df6d..5c041ce88b632333f390b4e08f2df87c6d62ea8d 100644 (file)
@@ -219,6 +219,7 @@ struct si_context {
        struct si_shader_ctx_state      fixed_func_tcs_shader;
        LLVMTargetMachineRef            tm; /* only non-threaded compilation */
        bool                            gfx_flush_in_progress;
+       bool                            compute_is_busy;
 
        /* Atoms (direct states). */
        union si_state_atoms            atoms;
index 9e50bb2904233625afd1aaa13556e64fec492b9d..ddcb904ec39e7dc0cd22624fcfabcf728a2307da 100644 (file)
@@ -785,10 +785,12 @@ void si_emit_cache_flush(struct si_context *si_ctx, struct r600_atom *atom)
                }
        }
 
-       if (sctx->flags & SI_CONTEXT_CS_PARTIAL_FLUSH) {
+       if (sctx->flags & SI_CONTEXT_CS_PARTIAL_FLUSH &&
+           si_ctx->compute_is_busy) {
                radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
                radeon_emit(cs, EVENT_TYPE(V_028A90_CS_PARTIAL_FLUSH | EVENT_INDEX(4)));
                sctx->num_cs_flushes++;
+               si_ctx->compute_is_busy = false;
        }
 
        /* VGT state synchronization. */