aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-07-05 10:05:49 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-05 18:09:11 -0400
commit67d5ced503db5b44cb82f378c9cb3f0e77a94e7f (patch)
tree99f8b0b84ca5f72e334437eb97422015f4d1ab74 /drivers/gpu/drm
parentedcaa5b12525f0de79e027ea1ae8a96ee7d785b3 (diff)
drm/radeon: fix surface setup on r1xx
r1xx asics have a slightly different surface register setup compared to newer asics. There is no specific enable bit for macro tiling, rather, to disable macro tiling, you need to set the surface pitch to 0. With this fixed, the special rn50 handling can go. Noticed-by: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/r100.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index d0314ecbd7c1..c9affefd79f6 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3077,6 +3077,10 @@ int r100_set_surface_reg(struct radeon_device *rdev, int reg,
3077 flags |= RADEON_SURF_TILE_COLOR_BOTH; 3077 flags |= RADEON_SURF_TILE_COLOR_BOTH;
3078 if (tiling_flags & RADEON_TILING_MACRO) 3078 if (tiling_flags & RADEON_TILING_MACRO)
3079 flags |= RADEON_SURF_TILE_COLOR_MACRO; 3079 flags |= RADEON_SURF_TILE_COLOR_MACRO;
3080 /* setting pitch to 0 disables tiling */
3081 if ((tiling_flags & (RADEON_TILING_MACRO|RADEON_TILING_MICRO))
3082 == 0)
3083 pitch = 0;
3080 } else if (rdev->family <= CHIP_RV280) { 3084 } else if (rdev->family <= CHIP_RV280) {
3081 if (tiling_flags & (RADEON_TILING_MACRO)) 3085 if (tiling_flags & (RADEON_TILING_MACRO))
3082 flags |= R200_SURF_TILE_COLOR_MACRO; 3086 flags |= R200_SURF_TILE_COLOR_MACRO;
@@ -3094,13 +3098,6 @@ int r100_set_surface_reg(struct radeon_device *rdev, int reg,
3094 if (tiling_flags & RADEON_TILING_SWAP_32BIT) 3098 if (tiling_flags & RADEON_TILING_SWAP_32BIT)
3095 flags |= RADEON_SURF_AP0_SWP_32BPP | RADEON_SURF_AP1_SWP_32BPP; 3099 flags |= RADEON_SURF_AP0_SWP_32BPP | RADEON_SURF_AP1_SWP_32BPP;
3096 3100
3097 /* when we aren't tiling the pitch seems to needs to be furtherdivided down. - tested on power5 + rn50 server */
3098 if (tiling_flags & (RADEON_TILING_SWAP_16BIT | RADEON_TILING_SWAP_32BIT)) {
3099 if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO)))
3100 if (ASIC_IS_RN50(rdev))
3101 pitch /= 16;
3102 }
3103
3104 /* r100/r200 divide by 16 */ 3101 /* r100/r200 divide by 16 */
3105 if (rdev->family < CHIP_R300) 3102 if (rdev->family < CHIP_R300)
3106 flags |= pitch / 16; 3103 flags |= pitch / 16;