mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
ac/radv/radeonsi: refactor raster_config default values getters.
This just makes this common code between the two drivers. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
8de7ff91be
commit
899df55ee0
4 changed files with 102 additions and 165 deletions
|
|
@ -554,3 +554,96 @@ ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family)
|
||||||
unreachable("Unknown GPU");
|
unreachable("Unknown GPU");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ac_get_raster_config(struct radeon_info *info,
|
||||||
|
uint32_t *raster_config_p,
|
||||||
|
uint32_t *raster_config_1_p)
|
||||||
|
{
|
||||||
|
unsigned num_rb = MIN2(info->num_render_backends, 16);
|
||||||
|
unsigned raster_config, raster_config_1;
|
||||||
|
switch (info->family) {
|
||||||
|
case CHIP_TAHITI:
|
||||||
|
case CHIP_PITCAIRN:
|
||||||
|
raster_config = 0x2a00126a;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_VERDE:
|
||||||
|
raster_config = 0x0000124a;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_OLAND:
|
||||||
|
raster_config = 0x00000082;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_HAINAN:
|
||||||
|
raster_config = 0x00000000;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_BONAIRE:
|
||||||
|
raster_config = 0x16000012;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_HAWAII:
|
||||||
|
raster_config = 0x3a00161a;
|
||||||
|
raster_config_1 = 0x0000002e;
|
||||||
|
break;
|
||||||
|
case CHIP_FIJI:
|
||||||
|
if (info->cik_macrotile_mode_array[0] == 0x000000e8) {
|
||||||
|
/* old kernels with old tiling config */
|
||||||
|
raster_config = 0x16000012;
|
||||||
|
raster_config_1 = 0x0000002a;
|
||||||
|
} else {
|
||||||
|
raster_config = 0x3a00161a;
|
||||||
|
raster_config_1 = 0x0000002e;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CHIP_POLARIS10:
|
||||||
|
raster_config = 0x16000012;
|
||||||
|
raster_config_1 = 0x0000002a;
|
||||||
|
break;
|
||||||
|
case CHIP_POLARIS11:
|
||||||
|
case CHIP_POLARIS12:
|
||||||
|
raster_config = 0x16000012;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_VEGAM:
|
||||||
|
raster_config = 0x3a00161a;
|
||||||
|
raster_config_1 = 0x0000002e;
|
||||||
|
break;
|
||||||
|
case CHIP_TONGA:
|
||||||
|
raster_config = 0x16000012;
|
||||||
|
raster_config_1 = 0x0000002a;
|
||||||
|
break;
|
||||||
|
case CHIP_ICELAND:
|
||||||
|
if (num_rb == 1)
|
||||||
|
raster_config = 0x00000000;
|
||||||
|
else
|
||||||
|
raster_config = 0x00000002;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_CARRIZO:
|
||||||
|
raster_config = 0x00000002;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_KAVERI:
|
||||||
|
/* KV should be 0x00000002, but that causes problems with radeon */
|
||||||
|
raster_config = 0x00000000; /* 0x00000002 */
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
case CHIP_KABINI:
|
||||||
|
case CHIP_MULLINS:
|
||||||
|
case CHIP_STONEY:
|
||||||
|
raster_config = 0x00000000;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr,
|
||||||
|
"ac: Unknown GPU, using 0 for raster_config\n");
|
||||||
|
raster_config = 0x00000000;
|
||||||
|
raster_config_1 = 0x00000000;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*raster_config_p = raster_config;
|
||||||
|
*raster_config_1_p = raster_config_1;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,9 @@ void ac_compute_driver_uuid(char *uuid, size_t size);
|
||||||
void ac_compute_device_uuid(struct radeon_info *info, char *uuid, size_t size);
|
void ac_compute_device_uuid(struct radeon_info *info, char *uuid, size_t size);
|
||||||
void ac_print_gpu_info(struct radeon_info *info);
|
void ac_print_gpu_info(struct radeon_info *info);
|
||||||
int ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family);
|
int ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family);
|
||||||
|
void ac_get_raster_config(struct radeon_info *info,
|
||||||
|
uint32_t *raster_config_p,
|
||||||
|
uint32_t *raster_config_1_p);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -234,88 +234,9 @@ si_set_raster_config(struct radv_physical_device *physical_device,
|
||||||
unsigned rb_mask = physical_device->rad_info.enabled_rb_mask;
|
unsigned rb_mask = physical_device->rad_info.enabled_rb_mask;
|
||||||
unsigned raster_config, raster_config_1;
|
unsigned raster_config, raster_config_1;
|
||||||
|
|
||||||
switch (physical_device->rad_info.family) {
|
ac_get_raster_config(&physical_device->rad_info,
|
||||||
case CHIP_TAHITI:
|
&raster_config,
|
||||||
case CHIP_PITCAIRN:
|
&raster_config_1);
|
||||||
raster_config = 0x2a00126a;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_VERDE:
|
|
||||||
raster_config = 0x0000124a;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_OLAND:
|
|
||||||
raster_config = 0x00000082;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_HAINAN:
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_BONAIRE:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_HAWAII:
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
break;
|
|
||||||
case CHIP_FIJI:
|
|
||||||
if (physical_device->rad_info.cik_macrotile_mode_array[0] == 0x000000e8) {
|
|
||||||
/* old kernels with old tiling config */
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
} else {
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CHIP_POLARIS10:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
break;
|
|
||||||
case CHIP_POLARIS11:
|
|
||||||
case CHIP_POLARIS12:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_VEGAM:
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
break;
|
|
||||||
case CHIP_TONGA:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
break;
|
|
||||||
case CHIP_ICELAND:
|
|
||||||
if (num_rb == 1)
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
else
|
|
||||||
raster_config = 0x00000002;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_CARRIZO:
|
|
||||||
raster_config = 0x00000002;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_KAVERI:
|
|
||||||
/* KV should be 0x00000002, but that causes problems with radeon */
|
|
||||||
raster_config = 0x00000000; /* 0x00000002 */
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_KABINI:
|
|
||||||
case CHIP_MULLINS:
|
|
||||||
case CHIP_STONEY:
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fprintf(stderr,
|
|
||||||
"radv: Unknown GPU, using 0 for raster_config\n");
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Always use the default config when all backends are enabled
|
/* Always use the default config when all backends are enabled
|
||||||
* (or when we failed to determine the enabled backends).
|
* (or when we failed to determine the enabled backends).
|
||||||
|
|
|
||||||
|
|
@ -4742,92 +4742,13 @@ si_write_harvested_raster_configs(struct si_context *sctx,
|
||||||
|
|
||||||
static void si_set_raster_config(struct si_context *sctx, struct si_pm4_state *pm4)
|
static void si_set_raster_config(struct si_context *sctx, struct si_pm4_state *pm4)
|
||||||
{
|
{
|
||||||
struct si_screen *sscreen = sctx->screen;
|
|
||||||
unsigned num_rb = MIN2(sctx->screen->info.num_render_backends, 16);
|
unsigned num_rb = MIN2(sctx->screen->info.num_render_backends, 16);
|
||||||
unsigned rb_mask = sctx->screen->info.enabled_rb_mask;
|
unsigned rb_mask = sctx->screen->info.enabled_rb_mask;
|
||||||
unsigned raster_config, raster_config_1;
|
unsigned raster_config, raster_config_1;
|
||||||
|
|
||||||
switch (sctx->family) {
|
ac_get_raster_config(&sctx->screen->info,
|
||||||
case CHIP_TAHITI:
|
&raster_config,
|
||||||
case CHIP_PITCAIRN:
|
&raster_config_1);
|
||||||
raster_config = 0x2a00126a;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_VERDE:
|
|
||||||
raster_config = 0x0000124a;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_OLAND:
|
|
||||||
raster_config = 0x00000082;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_HAINAN:
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_BONAIRE:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_HAWAII:
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
break;
|
|
||||||
case CHIP_FIJI:
|
|
||||||
if (sscreen->info.cik_macrotile_mode_array[0] == 0x000000e8) {
|
|
||||||
/* old kernels with old tiling config */
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
} else {
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CHIP_VEGAM:
|
|
||||||
raster_config = 0x3a00161a;
|
|
||||||
raster_config_1 = 0x0000002e;
|
|
||||||
break;
|
|
||||||
case CHIP_POLARIS10:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
break;
|
|
||||||
case CHIP_POLARIS11:
|
|
||||||
case CHIP_POLARIS12:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_TONGA:
|
|
||||||
raster_config = 0x16000012;
|
|
||||||
raster_config_1 = 0x0000002a;
|
|
||||||
break;
|
|
||||||
case CHIP_ICELAND:
|
|
||||||
if (num_rb == 1)
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
else
|
|
||||||
raster_config = 0x00000002;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_CARRIZO:
|
|
||||||
raster_config = 0x00000002;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_KAVERI:
|
|
||||||
/* KV should be 0x00000002, but that causes problems with radeon */
|
|
||||||
raster_config = 0x00000000; /* 0x00000002 */
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
case CHIP_KABINI:
|
|
||||||
case CHIP_MULLINS:
|
|
||||||
case CHIP_STONEY:
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fprintf(stderr,
|
|
||||||
"radeonsi: Unknown GPU, using 0 for raster_config\n");
|
|
||||||
raster_config = 0x00000000;
|
|
||||||
raster_config_1 = 0x00000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!rb_mask || util_bitcount(rb_mask) >= num_rb) {
|
if (!rb_mask || util_bitcount(rb_mask) >= num_rb) {
|
||||||
/* Always use the default config when all backends are enabled
|
/* Always use the default config when all backends are enabled
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue