diff options
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index fc928f3fc26..4ab2b8bf5b6 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -47,15 +47,14 @@ static void si_init_atom(struct r600_atom *atom, struct r600_atom **list_elem, *list_elem = atom; } -uint32_t si_num_banks(struct si_screen *sscreen, unsigned bpe, unsigned tile_split, - unsigned tile_mode_index) +uint32_t si_num_banks(struct si_screen *sscreen, struct r600_texture *tex) { - if ((sscreen->b.chip_class == CIK) && + if (sscreen->b.chip_class == CIK && sscreen->b.info.cik_macrotile_mode_array_valid) { unsigned index, tileb; - tileb = 8 * 8 * bpe; - tileb = MIN2(tile_split, tileb); + tileb = 8 * 8 * tex->surface.bpe; + tileb = MIN2(tex->surface.tile_split, tileb); for (index = 0; tileb > 64; index++) { tileb >>= 1; @@ -65,11 +64,14 @@ uint32_t si_num_banks(struct si_screen *sscreen, unsigned bpe, unsigned tile_spl return (sscreen->b.info.cik_macrotile_mode_array[index] >> 6) & 0x3; } - if ((sscreen->b.chip_class == SI) && + if (sscreen->b.chip_class == SI && sscreen->b.info.si_tile_mode_array_valid) { + /* Don't use stencil_tiling_index, because num_banks is always + * read from the depth mode. */ + unsigned tile_mode_index = tex->surface.tiling_index[0]; assert(tile_mode_index < 32); - return (sscreen->b.info.si_tile_mode_array[tile_mode_index] >> 20) & 0x3; + return G_009910_NUM_BANKS(sscreen->b.info.si_tile_mode_array[tile_mode_index]); } /* The old way. */ @@ -1820,8 +1822,7 @@ static void si_init_depth_surface(struct si_context *sctx, macro_aspect = cik_macro_tile_aspect(macro_aspect); bankw = cik_bank_wh(bankw); bankh = cik_bank_wh(bankh); - nbanks = si_num_banks(sscreen, rtex->surface.bpe, rtex->surface.tile_split, - ~0); + nbanks = si_num_banks(sscreen, rtex); tile_mode_index = si_tile_mode_index(rtex, level, false); pipe_config = cik_db_pipe_config(sscreen, tile_mode_index); |