drm/radeon/kms: properly compute group_size on 6xx/7xx
authorAlex Deucher <alexdeucher@gmail.com>
Tue, 19 Oct 2010 03:54:56 +0000 (23:54 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 26 Oct 2010 04:47:54 +0000 (14:47 +1000)
Needed for tiled surfaces.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/rv770.c

index 83ba9644dcb923aaff725dc316a460e644a79613..33952a12f0a31a49986a248a39c38cb48cdf618c 100644 (file)
@@ -1608,8 +1608,11 @@ void r600_gpu_init(struct radeon_device *rdev)
        rdev->config.r600.tiling_npipes = rdev->config.r600.max_tile_pipes;
        rdev->config.r600.tiling_nbanks = 4 << ((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
        tiling_config |= BANK_TILING((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
-       tiling_config |= GROUP_SIZE(0);
-       rdev->config.r600.tiling_group_size = 256;
+       tiling_config |= GROUP_SIZE((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
+       if ((ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
+               rdev->config.r600.tiling_group_size = 512;
+       else
+               rdev->config.r600.tiling_group_size = 256;
        tmp = (ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT;
        if (tmp > 3) {
                tiling_config |= ROW_TILING(3);
index ab83f688263afc0df50c9820116da6fadc86cfc0..245374e2b778b7706e9bf828c8a65876c1e11a00 100644 (file)
@@ -644,10 +644,11 @@ static void rv770_gpu_init(struct radeon_device *rdev)
        else
                gb_tiling_config |= BANK_TILING((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
        rdev->config.rv770.tiling_nbanks = 4 << ((gb_tiling_config >> 4) & 0x3);
-
-       gb_tiling_config |= GROUP_SIZE(0);
-       rdev->config.rv770.tiling_group_size = 256;
-
+       gb_tiling_config |= GROUP_SIZE((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT);
+       if ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT)
+               rdev->config.rv770.tiling_group_size = 512;
+       else
+               rdev->config.rv770.tiling_group_size = 256;
        if (((mc_arb_ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT) > 3) {
                gb_tiling_config |= ROW_TILING(3);
                gb_tiling_config |= SAMPLE_SPLIT(3);