Perf counters use the new max number.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5184>
util_bitcount(info->cu_mask[i][j]);
}
}
- info->num_good_cu_per_sh = info->num_good_compute_units /
- (info->max_se * info->max_sh_per_se);
- /* Round down to the nearest multiple of 2, because the hw can't
- * disable CUs. It can only disable whole WGPs (dual-CUs).
+ /* On GFX10, only whole WGPs (in units of 2 CUs) can be disabled,
+ * and max - min <= 2.
*/
- if (info->chip_class >= GFX10)
- info->num_good_cu_per_sh -= info->num_good_cu_per_sh % 2;
+ unsigned cu_group = info->chip_class >= GFX10 ? 2 : 1;
+ info->max_good_cu_per_sa = DIV_ROUND_UP(info->num_good_compute_units,
+ (info->max_se * info->max_sh_per_se * cu_group)) * cu_group;
+ info->min_good_cu_per_sa = (info->num_good_compute_units /
+ (info->max_se * info->max_sh_per_se * cu_group)) * cu_group;
memcpy(info->si_tile_mode_array, amdinfo->gb_tile_mode,
sizeof(amdinfo->gb_tile_mode));
printf("Shader core info:\n");
printf(" max_shader_clock = %i\n", info->max_shader_clock);
printf(" num_good_compute_units = %i\n", info->num_good_compute_units);
- printf(" num_good_cu_per_sh = %i\n", info->num_good_cu_per_sh);
+ printf(" max_good_cu_per_sa = %i\n", info->max_good_cu_per_sa);
+ printf(" min_good_cu_per_sa = %i\n", info->min_good_cu_per_sa);
printf(" max_se = %i\n", info->max_se);
printf(" max_sh_per_se = %i\n", info->max_sh_per_se);
printf(" max_wave64_per_simd = %i\n", info->max_wave64_per_simd);
uint32_t r600_max_quad_pipes; /* wave size / 16 */
uint32_t max_shader_clock;
uint32_t num_good_compute_units;
- uint32_t num_good_cu_per_sh;
+ uint32_t max_good_cu_per_sa;
+ uint32_t min_good_cu_per_sa; /* min != max if SAs have different # of CUs */
uint32_t max_se; /* shader engines */
uint32_t max_sh_per_se; /* shader arrays per shader engine */
uint32_t max_wave64_per_simd;
properties->shaderArraysPerEngineCount =
pdevice->rad_info.max_sh_per_se;
properties->computeUnitsPerShaderArray =
- pdevice->rad_info.num_good_cu_per_sh;
+ pdevice->rad_info.min_good_cu_per_sa;
properties->simdPerComputeUnit =
pdevice->rad_info.num_simd_per_compute_unit;
properties->wavefrontsPerSimd =
chunk->vgprs_per_simd = rad_info->num_physical_wave64_vgprs_per_simd;
chunk->sgprs_per_simd = rad_info->num_physical_sgprs_per_simd;
chunk->shader_engines = rad_info->max_se;
- chunk->compute_unit_per_shader_engine = rad_info->num_good_cu_per_sh;
+ chunk->compute_unit_per_shader_engine = rad_info->min_good_cu_per_sa;
chunk->simd_per_compute_unit = rad_info->num_simd_per_compute_unit;
chunk->wavefronts_per_simd = rad_info->max_wave64_per_simd;
}
/* Compute LATE_ALLOC_VS.LIMIT. */
- unsigned num_cu_per_sh = physical_device->rad_info.num_good_cu_per_sh;
+ unsigned num_cu_per_sh = physical_device->rad_info.min_good_cu_per_sa;
unsigned late_alloc_wave64 = 0; /* The limit is per SH. */
unsigned late_alloc_wave64_gs = 0;
unsigned cu_mask_vs = 0xffff;
else if (!strcmp(block->b->b->name, "TA") ||
!strcmp(block->b->b->name, "TCP") ||
!strcmp(block->b->b->name, "TD")) {
- block->num_instances = MAX2(1, screen->info.num_good_cu_per_sh);
+ block->num_instances = MAX2(1, screen->info.max_good_cu_per_sa);
}
if (si_pc_block_has_per_instance_groups(pc, block)) {
}
/* Compute LATE_ALLOC_VS.LIMIT. */
- unsigned num_cu_per_sh = sscreen->info.num_good_cu_per_sh;
+ unsigned num_cu_per_sh = sscreen->info.min_good_cu_per_sa;
unsigned late_alloc_wave64 = 0; /* The limit is per SH. */
unsigned cu_mask_vs = 0xffff;
unsigned cu_mask_gs = 0xffff;
S_00B22C_LDS_SIZE(shader->config.lds_size));
/* Determine LATE_ALLOC_GS. */
- unsigned num_cu_per_sh = sscreen->info.num_good_cu_per_sh;
+ unsigned num_cu_per_sh = sscreen->info.min_good_cu_per_sa;
unsigned late_alloc_wave64; /* The limit is per SH. */
/* For Wave32, the hw will launch twice the number of late
radeon_get_drm_value(ws->fd, RADEON_INFO_MAX_SH_PER_SE, NULL,
&ws->info.max_sh_per_se);
if (ws->gen == DRV_SI) {
- ws->info.num_good_cu_per_sh = ws->info.num_good_compute_units /
+ ws->info.max_good_cu_per_sa =
+ ws->info.min_good_cu_per_sa = ws->info.num_good_compute_units /
(ws->info.max_se * ws->info.max_sh_per_se);
}