Commit 5b23c9045a8b61352986270b2d109edf5085e113

Authored by Alex Deucher
1 parent c8d15edc17

drm/radeon: fix bank tiling parameters on cayman

Handle the 16 bank case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

Showing 1 changed file with 11 additions and 3 deletions Side-by-side Diff

drivers/gpu/drm/radeon/ni.c
... ... @@ -574,10 +574,18 @@
574 574 if (rdev->flags & RADEON_IS_IGP)
575 575 rdev->config.cayman.tile_config |= 1 << 4;
576 576 else {
577   - if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
578   - rdev->config.cayman.tile_config |= 1 << 4;
579   - else
  577 + switch ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) {
  578 + case 0: /* four banks */
580 579 rdev->config.cayman.tile_config |= 0 << 4;
  580 + break;
  581 + case 1: /* eight banks */
  582 + rdev->config.cayman.tile_config |= 1 << 4;
  583 + break;
  584 + case 2: /* sixteen banks */
  585 + default:
  586 + rdev->config.cayman.tile_config |= 2 << 4;
  587 + break;
  588 + }
581 589 }
582 590 rdev->config.cayman.tile_config |=
583 591 ((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;