radeonsi: let internal compute dispatches tune WAVES_PER_SH
authorMarek Olšák <marek.olsak@amd.com>
Thu, 2 Aug 2018 20:37:17 +0000 (16:37 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Aug 2018 19:31:42 +0000 (15:31 -0400)
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_pipe.h

index c5d3d5fcf029c9d02e6cd6167f8f6930dd113a1e..e0c6902fec46926d73119b57558e2842a7429726 100644 (file)
@@ -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,
index 100d0166f626cd5a6f036156a32727d4d30b259d..fe06064b3885be325847ffa4b06903fbd86ad59b 100644 (file)
@@ -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;