[Mesa-dev] [PATCH 1/2] radeonsi: Add CE synchronization for compute dispatches.

Marek Olšák maraeo at gmail.com
Tue Apr 19 15:43:11 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Apr 19, 2016 at 2:51 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  src/gallium/drivers/radeonsi/si_compute.c    | 4 ++++
>  src/gallium/drivers/radeonsi/si_state.h      | 2 ++
>  src/gallium/drivers/radeonsi/si_state_draw.c | 4 ++--
>  3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index 105cf8c..557e892 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -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);
>  }
>
>
> diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
> index 3679532..c4b2b45 100644
> --- a/src/gallium/drivers/radeonsi/si_state.h
> +++ b/src/gallium/drivers/radeonsi/si_state.h
> @@ -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);
>
> diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
> index 15d58d4..b61c05a 100644
> --- a/src/gallium/drivers/radeonsi/si_state_draw.c
> +++ b/src/gallium/drivers/radeonsi/si_state_draw.c
> @@ -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));
> --
> 2.8.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list