ac/gpu_info: rearrange if checks for dcc config

rearrange the if checks so that there is less if checks
for newer gpus.

v2: fix block comment coding guideline (Marek Olšák)
    simplify gfx9 if condition (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23454>
This commit is contained in:
Yogesh Mohan Marimuthu
2023-06-06 11:34:05 +05:30
committed by Marge Bot
parent 6f968f46fe
commit 7761e93c8c
+16 -15
View File
@@ -1279,23 +1279,24 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info)
if (info->gfx_level >= GFX9)
info->ib_alignment = MAX2(info->ib_alignment, info->tcc_cache_line_size);
if ((info->drm_minor >= 31 && (info->family == CHIP_RAVEN || info->family == CHIP_RAVEN2 ||
info->family == CHIP_RENOIR)) ||
info->gfx_level >= GFX10_3) {
/* GFX10+ requires retiling in all cases. */
if (info->max_render_backends == 1 && info->gfx_level == GFX9) {
if (info->gfx_level >= GFX11) {
/* With num_cu = 4 in gfx11 measured power for idle, video playback and observed
* power savings, hence enable dcc with retile for gfx11 with num_cu >= 4.
*/
info->use_display_dcc_with_retile_blit = info->num_cu >= 4;
} else if (info->gfx_level >= GFX10_3) {
/* Displayable DCC with retiling is known to increase power consumption on Raphael
* and Mendocino, so disable it on the smallest APUs. We need a proof that
* displayable DCC doesn't regress bigger chips in the same way.
*/
info->use_display_dcc_with_retile_blit = info->num_cu > 4;
} else if (info->gfx_level == GFX9 && !info->has_dedicated_vram &&
info->drm_minor >= 31) {
if (info->max_render_backends == 1) {
info->use_display_dcc_unaligned = true;
} else {
/* Displayable DCC with retiling is known to increase power consumption on Raphael
* and Mendocino, so disable it on the smallest APUs. We need a proof that
* displayable DCC doesn't regress bigger chips in the same way.
* With num_cu = 4 in gfx11 measured power for idle, video playback and observed
* power savings, hence enable dcc with retile for gfx11 with num_cu >= 4.
*/
if (info->gfx_level >= GFX11)
info->use_display_dcc_with_retile_blit = info->num_cu >= 4;
else
info->use_display_dcc_with_retile_blit = info->num_cu > 4;
/* there may be power increase for small APUs with less num_cu. */
info->use_display_dcc_with_retile_blit = info->num_cu > 4;
}
}