diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-05-20 12:04:59 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-01 20:00:01 -0400 |
commit | 40c4ac1c1931eb48ca0cf5e9ec464d13c5921994 (patch) | |
tree | f83bf40236519c2eef1fbefb561575aa62845384 | |
parent | 21a8122ad38c60d73fe5dc51051414c3564d174a (diff) |
drm/radeon/kms: Add crtc tiling setup support for r6xx/r7xx
Needed for scanning out of a tiled buffer.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r500_reg.h | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index a22d5a3bca4e..3b8f087eaf62 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1000,11 +1000,18 @@ static int avivo_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
1000 | return -EINVAL; | 1000 | return -EINVAL; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | if (tiling_flags & RADEON_TILING_MACRO) | 1003 | if (rdev->family >= CHIP_R600) { |
1004 | fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE; | 1004 | if (tiling_flags & RADEON_TILING_MACRO) |
1005 | fb_format |= R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1; | ||
1006 | else if (tiling_flags & RADEON_TILING_MICRO) | ||
1007 | fb_format |= R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1; | ||
1008 | } else { | ||
1009 | if (tiling_flags & RADEON_TILING_MACRO) | ||
1010 | fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE; | ||
1005 | 1011 | ||
1006 | if (tiling_flags & RADEON_TILING_MICRO) | 1012 | if (tiling_flags & RADEON_TILING_MICRO) |
1007 | fb_format |= AVIVO_D1GRPH_TILED; | 1013 | fb_format |= AVIVO_D1GRPH_TILED; |
1014 | } | ||
1008 | 1015 | ||
1009 | if (radeon_crtc->crtc_id == 0) | 1016 | if (radeon_crtc->crtc_id == 0) |
1010 | WREG32(AVIVO_D1VGA_CONTROL, 0); | 1017 | WREG32(AVIVO_D1VGA_CONTROL, 0); |
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h index 93c9a2bbccf8..6ac1f604e29b 100644 --- a/drivers/gpu/drm/radeon/r500_reg.h +++ b/drivers/gpu/drm/radeon/r500_reg.h | |||
@@ -386,6 +386,11 @@ | |||
386 | # define AVIVO_D1GRPH_TILED (1 << 20) | 386 | # define AVIVO_D1GRPH_TILED (1 << 20) |
387 | # define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21) | 387 | # define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21) |
388 | 388 | ||
389 | # define R600_D1GRPH_ARRAY_MODE_LINEAR_GENERAL (0 << 20) | ||
390 | # define R600_D1GRPH_ARRAY_MODE_LINEAR_ALIGNED (1 << 20) | ||
391 | # define R600_D1GRPH_ARRAY_MODE_1D_TILED_THIN1 (2 << 20) | ||
392 | # define R600_D1GRPH_ARRAY_MODE_2D_TILED_THIN1 (4 << 20) | ||
393 | |||
389 | /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2 | 394 | /* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2 |
390 | * block and vice versa. This applies to GRPH, CUR, etc. | 395 | * block and vice versa. This applies to GRPH, CUR, etc. |
391 | */ | 396 | */ |