diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-02-06 14:23:26 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-13 18:22:53 -0500 |
commit | c9417bdd4c6b1b92a21608c07e83afa419c7bb62 (patch) | |
tree | e07aefe163ea44b352cf2a4ba7653e89efe1b7fb /drivers | |
parent | 16f9fdcbcce74102bed9a4b7ccc1fb05b5dd6ca3 (diff) |
drm/radeon/kms: fix interlaced modes on dce4+
- set scaler table clears the interleave bit, need to
reset it in encoder quirks, this was already done for
pre-dce4.
- remove the interleave settings from set_base() functions
this is now handled in the encoder quirks functions, and
isn't technically part of the display base setup.
- rename evergreen_do_set_base() to dce4_do_set_base() since
it's used on both evergreen and NI asics.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28182
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 20 |
2 files changed, 20 insertions, 22 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index b1537000a104..dd4e3acf79c0 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -995,9 +995,9 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode | |||
995 | } | 995 | } |
996 | } | 996 | } |
997 | 997 | ||
998 | static int evergreen_crtc_do_set_base(struct drm_crtc *crtc, | 998 | static int dce4_crtc_do_set_base(struct drm_crtc *crtc, |
999 | struct drm_framebuffer *fb, | 999 | struct drm_framebuffer *fb, |
1000 | int x, int y, int atomic) | 1000 | int x, int y, int atomic) |
1001 | { | 1001 | { |
1002 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1002 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1003 | struct drm_device *dev = crtc->dev; | 1003 | struct drm_device *dev = crtc->dev; |
@@ -1137,12 +1137,6 @@ static int evergreen_crtc_do_set_base(struct drm_crtc *crtc, | |||
1137 | WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset, | 1137 | WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset, |
1138 | (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); | 1138 | (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); |
1139 | 1139 | ||
1140 | if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) | ||
1141 | WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, | ||
1142 | EVERGREEN_INTERLEAVE_EN); | ||
1143 | else | ||
1144 | WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0); | ||
1145 | |||
1146 | if (!atomic && fb && fb != crtc->fb) { | 1140 | if (!atomic && fb && fb != crtc->fb) { |
1147 | radeon_fb = to_radeon_framebuffer(fb); | 1141 | radeon_fb = to_radeon_framebuffer(fb); |
1148 | rbo = radeon_fb->obj->driver_private; | 1142 | rbo = radeon_fb->obj->driver_private; |
@@ -1300,12 +1294,6 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1300 | WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset, | 1294 | WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset, |
1301 | (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); | 1295 | (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); |
1302 | 1296 | ||
1303 | if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) | ||
1304 | WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, | ||
1305 | AVIVO_D1MODE_INTERLEAVE_EN); | ||
1306 | else | ||
1307 | WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0); | ||
1308 | |||
1309 | if (!atomic && fb && fb != crtc->fb) { | 1297 | if (!atomic && fb && fb != crtc->fb) { |
1310 | radeon_fb = to_radeon_framebuffer(fb); | 1298 | radeon_fb = to_radeon_framebuffer(fb); |
1311 | rbo = radeon_fb->obj->driver_private; | 1299 | rbo = radeon_fb->obj->driver_private; |
@@ -1329,7 +1317,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
1329 | struct radeon_device *rdev = dev->dev_private; | 1317 | struct radeon_device *rdev = dev->dev_private; |
1330 | 1318 | ||
1331 | if (ASIC_IS_DCE4(rdev)) | 1319 | if (ASIC_IS_DCE4(rdev)) |
1332 | return evergreen_crtc_do_set_base(crtc, old_fb, x, y, 0); | 1320 | return dce4_crtc_do_set_base(crtc, old_fb, x, y, 0); |
1333 | else if (ASIC_IS_AVIVO(rdev)) | 1321 | else if (ASIC_IS_AVIVO(rdev)) |
1334 | return avivo_crtc_do_set_base(crtc, old_fb, x, y, 0); | 1322 | return avivo_crtc_do_set_base(crtc, old_fb, x, y, 0); |
1335 | else | 1323 | else |
@@ -1344,7 +1332,7 @@ int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, | |||
1344 | struct radeon_device *rdev = dev->dev_private; | 1332 | struct radeon_device *rdev = dev->dev_private; |
1345 | 1333 | ||
1346 | if (ASIC_IS_DCE4(rdev)) | 1334 | if (ASIC_IS_DCE4(rdev)) |
1347 | return evergreen_crtc_do_set_base(crtc, fb, x, y, 1); | 1335 | return dce4_crtc_do_set_base(crtc, fb, x, y, 1); |
1348 | else if (ASIC_IS_AVIVO(rdev)) | 1336 | else if (ASIC_IS_AVIVO(rdev)) |
1349 | return avivo_crtc_do_set_base(crtc, fb, x, y, 1); | 1337 | return avivo_crtc_do_set_base(crtc, fb, x, y, 1); |
1350 | else | 1338 | else |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d4a542247618..5b38b73ccd12 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -1570,11 +1570,21 @@ atombios_apply_encoder_quirks(struct drm_encoder *encoder, | |||
1570 | } | 1570 | } |
1571 | 1571 | ||
1572 | /* set scaler clears this on some chips */ | 1572 | /* set scaler clears this on some chips */ |
1573 | /* XXX check DCE4 */ | 1573 | if (ASIC_IS_AVIVO(rdev) && |
1574 | if (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))) { | 1574 | (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)))) { |
1575 | if (ASIC_IS_AVIVO(rdev) && (mode->flags & DRM_MODE_FLAG_INTERLACE)) | 1575 | if (ASIC_IS_DCE4(rdev)) { |
1576 | WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, | 1576 | if (mode->flags & DRM_MODE_FLAG_INTERLACE) |
1577 | AVIVO_D1MODE_INTERLEAVE_EN); | 1577 | WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, |
1578 | EVERGREEN_INTERLEAVE_EN); | ||
1579 | else | ||
1580 | WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0); | ||
1581 | } else { | ||
1582 | if (mode->flags & DRM_MODE_FLAG_INTERLACE) | ||
1583 | WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, | ||
1584 | AVIVO_D1MODE_INTERLEAVE_EN); | ||
1585 | else | ||
1586 | WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0); | ||
1587 | } | ||
1578 | } | 1588 | } |
1579 | } | 1589 | } |
1580 | 1590 | ||