Subject: [PATCH] drm/radeon/kms: fix reversed logic in panel scaling setup

From: Alex Deucher <[email-masked]>
Date: Fri, 30 Apr 2010 11:09:14 -0400

legacy chips need the native mode, avivo chips also need
to update the h/vdisplay to the scaled mode size.  The logic
was reversed.  Should fix scaled mode setup on avivo and legacy
chips.

Signed-off-by: Alex Deucher <[email-masked]>
---
 drivers/gpu/drm/radeon/radeon_encoders.c        |    2 +-
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |    4 ----
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index 256036b..482ded7 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -276,7 +276,7 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
 		struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
 		int mode_id = adjusted_mode->base.id;
 		*adjusted_mode = *native_mode;
-		if (!ASIC_IS_AVIVO(rdev)) {
+		if (ASIC_IS_AVIVO(rdev)) {
 			adjusted_mode->hdisplay = mode->hdisplay;
 			adjusted_mode->vdisplay = mode->vdisplay;
 			adjusted_mode->crtc_hdisplay = mode->hdisplay;
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 341df86..af550c5 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -225,10 +225,6 @@ static bool radeon_legacy_mode_fixup(struct drm_encoder *encoder,
 		struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
 		int mode_id = adjusted_mode->base.id;
 		*adjusted_mode = *native_mode;
-		adjusted_mode->hdisplay = mode->hdisplay;
-		adjusted_mode->vdisplay = mode->vdisplay;
-		adjusted_mode->crtc_hdisplay = mode->hdisplay;
-		adjusted_mode->crtc_vdisplay = mode->vdisplay;
 		adjusted_mode->base.id = mode_id;
 	}
 
-- 
1.5.6.3