ac: move ac_get_max_wave64_per_simd into radeon_info
authorMarek Olšák <marek.olsak@amd.com>
Thu, 12 Sep 2019 23:39:02 +0000 (19:39 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 18 Sep 2019 18:39:06 +0000 (14:39 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/amd/vulkan/radv_shader.c
src/gallium/drivers/radeonsi/si_shader.c

index 0c6e8cbfb984c422272890ba31c8b1ccf8a9bad2..cc7cbc11ee60770fe54f30d0e26dd6446e92b1cb 100644 (file)
@@ -584,6 +584,8 @@ bool ac_query_gpu_info(int fd, void *dev_p,
                }
        }
 
+       info->max_wave64_per_simd = info->family >= CHIP_POLARIS10 &&
+                                   info->family <= CHIP_VEGAM ? 8 : 10;
        return true;
 }
 
index 1e42a2a434bcb5880da3883d6d8c6500c56c13a1..7ab9bb11e49c0b155689af0465c20d8d37c3a08e 100644 (file)
@@ -141,6 +141,7 @@ struct radeon_info {
        uint32_t                    num_tcc_blocks;
        uint32_t                    max_se; /* shader engines */
        uint32_t                    max_sh_per_se; /* shader arrays per shader engine */
+       uint32_t                    max_wave64_per_simd;
 
        /* Render backends (color + depth blocks). */
        uint32_t                    r300_num_gb_pipes;
@@ -189,21 +190,6 @@ unsigned ac_get_compute_resource_limits(struct radeon_info *info,
                                        unsigned max_waves_per_sh,
                                        unsigned threadgroups_per_cu);
 
-static inline unsigned ac_get_max_wave64_per_simd(enum radeon_family family)
-{
-
-       switch (family) {
-       /* These always have 8 waves: */
-       case CHIP_POLARIS10:
-       case CHIP_POLARIS11:
-       case CHIP_POLARIS12:
-       case CHIP_VEGAM:
-               return 8;
-       default:
-               return 10;
-       }
-}
-
 static inline unsigned ac_get_num_physical_vgprs(enum chip_class chip_class,
                                                 unsigned wave_size)
 {
@@ -221,7 +207,7 @@ ac_get_num_physical_sgprs(const struct radeon_info *info)
         * of Wave32, which is double the number for Wave64.
         */
        if (info->chip_class >= GFX10)
-               return 128 * ac_get_max_wave64_per_simd(info->family) * 2;
+               return 128 * info->max_wave64_per_simd * 2;
 
        return info->chip_class >= GFX8 ? 800 : 512;
 }
index 02a8712a972c90b1b9a3c9226a2434361fc08c61..b875b98908816393a64fd51b80ee55593c857cc8 100644 (file)
@@ -1258,7 +1258,7 @@ radv_get_max_waves(struct radv_device *device,
        unsigned max_simd_waves;
        unsigned lds_per_wave = 0;
 
-       max_simd_waves = ac_get_max_wave64_per_simd(device->physical_device->rad_info.family);
+       max_simd_waves = device->physical_device->rad_info.max_wave64_per_simd;
 
        if (stage == MESA_SHADER_FRAGMENT) {
                lds_per_wave = conf->lds_size * lds_increment +
index cbe393d03c74ef11db40ff727a5bd9df6a6f5a14..de1ad16a34bf2a0f3575bfeebebd9f41b8a1f7e7 100644 (file)
@@ -5420,7 +5420,7 @@ static void si_calculate_max_simd_waves(struct si_shader *shader)
        unsigned lds_per_wave = 0;
        unsigned max_simd_waves;
 
-       max_simd_waves = ac_get_max_wave64_per_simd(sscreen->info.family);
+       max_simd_waves = sscreen->info.max_wave64_per_simd;
 
        /* Compute LDS usage for PS. */
        switch (shader->selector->type) {