summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2014-04-18 13:03:37 -0400
committerAlex Deucher <[email protected]>2014-04-18 13:24:12 -0400
commit7489f3eedafbdad905158196873c8b3f5ccb546f (patch)
treea3af1d9986b734175bd7b655056ece1e4d1a57c6 /src/gallium/drivers/radeonsi/si_state.c
parentf770123f58b46459e8dbd27525162ee8ba89f30b (diff)
radeonsi: fix num banks selection on SI for dma setup (v2)
The number of banks varies based on the tile mode index just like CIK. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77533 v2: fix ordering for nbanks calculation for consistency Signed-off-by: Alex Deucher <[email protected]>
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: