summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index ab9c4cc2834..211a6152e0c 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -47,23 +47,31 @@ static void si_init_atom(struct r600_atom *atom, struct r600_atom **list_elem,
*list_elem = atom;
}
-static uint32_t cik_num_banks(struct si_screen *sscreen, unsigned bpe, unsigned tile_split)
+uint32_t cik_num_banks(struct si_screen *sscreen, unsigned bpe, unsigned tile_split)
{
- if (sscreen->b.info.cik_macrotile_mode_array_valid) {
- unsigned index, tileb;
+ unsigned index, tileb;
- tileb = 8 * 8 * bpe;
- tileb = MIN2(tile_split, tileb);
+ tileb = 8 * 8 * bpe;
+ tileb = MIN2(tile_split, tileb);
- for (index = 0; tileb > 64; index++) {
- tileb >>= 1;
- }
+ for (index = 0; tileb > 64; index++) {
+ tileb >>= 1;
+ }
+ if ((sscreen->b.chip_class == CIK) &&
+ sscreen->b.info.cik_macrotile_mode_array_valid) {
assert(index < 16);
return (sscreen->b.info.cik_macrotile_mode_array[index] >> 6) & 0x3;
}
+ if ((sscreen->b.chip_class == SI) &&
+ sscreen->b.info.si_tile_mode_array_valid) {
+ assert(index < 16);
+
+ return (sscreen->b.info.si_tile_mode_array[index] >> 20) & 0x3;
+ }
+
/* The old way. */
switch (sscreen->b.tiling_info.num_banks) {
case 2: