]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
drm/radeon/kms: Add crtc tiling setup support for r6xx/r7xx
authorAlex Deucher <alexdeucher@gmail.com>
Thu, 20 May 2010 16:04:59 +0000 (12:04 -0400)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Aug 2010 00:00:01 +0000 (10:00 +1000)
Needed for scanning out of a tiled buffer.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/r500_reg.h

index a22d5a3bca4ed63d695c7f433c4b343cd462a720..3b8f087eaf62da6241077c61efaeaeb6c784bb6e 100644 (file)
@@ -1000,11 +1000,18 @@ static int avivo_crtc_set_base(struct drm_crtc *crtc, int x, int y,
                return -EINVAL;
        }
 
-       if (tiling_flags & RADEON_TILING_MACRO)
-               fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE;
+       if (rdev->family >= CHIP_R600) {
+               if (tiling_flags & RADEON_TILING_MACRO)
+                       fb_format |= R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1;
+               else if (tiling_flags & RADEON_TILING_MICRO)
+                       fb_format |= R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1;
+       } else {
+               if (tiling_flags & RADEON_TILING_MACRO)
+                       fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE;
 
-       if (tiling_flags & RADEON_TILING_MICRO)
-               fb_format |= AVIVO_D1GRPH_TILED;
+               if (tiling_flags & RADEON_TILING_MICRO)
+                       fb_format |= AVIVO_D1GRPH_TILED;
+       }
 
        if (radeon_crtc->crtc_id == 0)
                WREG32(AVIVO_D1VGA_CONTROL, 0);
index 93c9a2bbccf88b856eaf3c9a2cc6e0592cb7fb32..6ac1f604e29be8afd2eb7d16cd43ffd1c4817458 100644 (file)
 #       define AVIVO_D1GRPH_TILED                               (1 << 20)
 #       define AVIVO_D1GRPH_MACRO_ADDRESS_MODE                  (1 << 21)
 
+#       define R600_D1GRPH_ARRAY_MODE_LINEAR_GENERAL            (0 << 20)
+#       define R600_D1GRPH_ARRAY_MODE_LINEAR_ALIGNED            (1 << 20)
+#       define R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1            (2 << 20)
+#       define R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1            (4 << 20)
+
 /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2
  * block and vice versa.  This applies to GRPH, CUR, etc.
  */