radeonsi: Add CE synchronization for compute dispatches.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 19 Apr 2016 11:52:32 +0000 (13:52 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 19 Apr 2016 16:31:23 +0000 (18:31 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 105cf8cb99fab6bfe811010f1d1480aa01aeba3b..557e89236fa62010ede4f7763630c0244e574751 100644 (file)
@@ -474,7 +474,11 @@ static void si_launch_grid(
        if (program->ir_type == PIPE_SHADER_IR_TGSI)
                si_setup_tgsi_grid(sctx, info);
 
+       si_ce_pre_draw_synchronization(sctx);
+
        si_emit_dispatch_packets(sctx, info);
+
+       si_ce_post_draw_synchronization(sctx);
 }
 
 
index 3679532a86c8e0f4dc656c30a4b356f9d0bcd9f1..c4b2b458241c63c14050e3bb812fa73b78e79f67 100644 (file)
@@ -321,6 +321,8 @@ void si_destroy_shader_cache(struct si_screen *sscreen);
 
 /* si_state_draw.c */
 void si_emit_cache_flush(struct si_context *sctx, struct r600_atom *atom);
+void si_ce_pre_draw_synchronization(struct si_context *sctx);
+void si_ce_post_draw_synchronization(struct si_context *sctx);
 void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo);
 void si_trace_emit(struct si_context *sctx);
 
index 15d58d412d3c2cd3a8a6e5c30dd148691c6fb863..b61c05ac866902b4ae661373e3d34d5abcf945ea 100644 (file)
@@ -750,7 +750,7 @@ static void si_get_draw_start_count(struct si_context *sctx,
        }
 }
 
-static void si_ce_pre_draw_synchronization(struct si_context *sctx)
+void si_ce_pre_draw_synchronization(struct si_context *sctx)
 {
        if (sctx->ce_need_synchronization) {
                radeon_emit(sctx->ce_ib, PKT3(PKT3_INCREMENT_CE_COUNTER, 0, 0));
@@ -761,7 +761,7 @@ static void si_ce_pre_draw_synchronization(struct si_context *sctx)
        }
 }
 
-static void si_ce_post_draw_synchronization(struct si_context *sctx)
+void si_ce_post_draw_synchronization(struct si_context *sctx)
 {
        if (sctx->ce_need_synchronization) {
                radeon_emit(sctx->b.gfx.cs, PKT3(PKT3_INCREMENT_DE_COUNTER, 0, 0));