From: Marek Olšák Date: Thu, 2 Aug 2018 20:37:17 +0000 (-0400) Subject: radeonsi: let internal compute dispatches tune WAVES_PER_SH X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5914f5bd4a2566d39dc14f4dc907900210923a37;p=mesa.git radeonsi: let internal compute dispatches tune WAVES_PER_SH --- diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index c5d3d5fcf02..e0c6902fec4 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -784,6 +784,14 @@ static void si_emit_dispatch_packets(struct si_context *sctx, */ if (num_cu_per_se % 4 && waves_per_threadgroup == 1) compute_resource_limits |= S_00B854_FORCE_SIMD_DIST(1); + + compute_resource_limits |= S_00B854_WAVES_PER_SH(sctx->cs_max_waves_per_sh); + } else { + /* SI */ + if (sctx->cs_max_waves_per_sh) { + unsigned limit_div16 = DIV_ROUND_UP(sctx->cs_max_waves_per_sh, 16); + compute_resource_limits |= S_00B854_WAVES_PER_SH_SI(limit_div16); + } } radeon_set_sh_reg(cs, R_00B854_COMPUTE_RESOURCE_LIMITS, diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 100d0166f62..fe06064b388 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -825,6 +825,7 @@ struct si_context { /* shader information */ struct si_vertex_elements *vertex_elements; unsigned sprite_coord_enable; + unsigned cs_max_waves_per_sh; bool flatshade; bool do_update_shaders;