drm/radeon/kms: fix tiling info on evergreen

We aren't currently using tiling in userspace on evergreen,
but the info we currently return for the tiling info query
(gb_addr_config) is no adequate for userspace tiling alignment
calculations. It does not contain the bank info. Create a custom
tiling info dword with all the necessary info (num channels,
num banks, group size, row size).

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by Alex Deucher and committed by Dave Airlie 1aa52bd3 268b2510

+30 -1
+30 -1
drivers/gpu/drm/radeon/evergreen.c
··· 1650 1650 } 1651 1651 } 1652 1652 1653 - rdev->config.evergreen.tile_config = gb_addr_config; 1653 + /* setup tiling info dword. gb_addr_config is not adequate since it does 1654 + * not have bank info, so create a custom tiling dword. 1655 + * bits 3:0 num_pipes 1656 + * bits 7:4 num_banks 1657 + * bits 11:8 group_size 1658 + * bits 15:12 row_size 1659 + */ 1660 + rdev->config.evergreen.tile_config = 0; 1661 + switch (rdev->config.evergreen.max_tile_pipes) { 1662 + case 1: 1663 + default: 1664 + rdev->config.evergreen.tile_config |= (0 << 0); 1665 + break; 1666 + case 2: 1667 + rdev->config.evergreen.tile_config |= (1 << 0); 1668 + break; 1669 + case 4: 1670 + rdev->config.evergreen.tile_config |= (2 << 0); 1671 + break; 1672 + case 8: 1673 + rdev->config.evergreen.tile_config |= (3 << 0); 1674 + break; 1675 + } 1676 + rdev->config.evergreen.tile_config |= 1677 + ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4; 1678 + rdev->config.evergreen.tile_config |= 1679 + ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8; 1680 + rdev->config.evergreen.tile_config |= 1681 + ((gb_addr_config & 0x30000000) >> 28) << 12; 1682 + 1654 1683 WREG32(GB_BACKEND_MAP, gb_backend_map); 1655 1684 WREG32(GB_ADDR_CONFIG, gb_addr_config); 1656 1685 WREG32(DMIF_ADDR_CONFIG, gb_addr_config);