Mesa (master): radeonsi: let internal compute dispatches tune WAVES_PER_SH
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 29 19:32:05 UTC 2018
Module: Mesa
Branch: master
Commit: 5914f5bd4a2566d39dc14f4dc907900210923a37
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5914f5bd4a2566d39dc14f4dc907900210923a37
Author: Marek Olšák <marek.olsak at amd.com>
Date: Thu Aug 2 16:37:17 2018 -0400
radeonsi: let internal compute dispatches tune WAVES_PER_SH
---
src/gallium/drivers/radeonsi/si_compute.c | 8 ++++++++
src/gallium/drivers/radeonsi/si_pipe.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index c5d3d5fcf0..e0c6902fec 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 100d0166f6..fe06064b38 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;
More information about the mesa-commit
mailing list