summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-06 19:44:17 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-06 19:44:17 -0500
commitbba5d806cc46328ad9e4c521bfeeb2a59f96862b (patch)
tree6043fbdb20625190b9e88ef0817641a10f266b7b
parent28cf3492f431f325cb08d7c6aade43d8886df3f6 (diff)
AVIVO: better fix for rotation
This should handle initial rotation as well.
-rw-r--r--src/atombios_crtc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index e86f1865..e79ba138 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -455,6 +455,23 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
x = 0;
y = 0;
fb_location = fb_location + (char *)crtc->rotatedData - (char *)info->FB;
+ switch (crtc->rotation) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ OUTREG(AVIVO_D1GRPH_X_END + radeon_crtc->crtc_offset, pScrn->virtualX);
+ OUTREG(AVIVO_D1GRPH_Y_END + radeon_crtc->crtc_offset, pScrn->virtualY);
+ default:
+ break;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ OUTREG(AVIVO_D1GRPH_X_END + radeon_crtc->crtc_offset, pScrn->virtualY);
+ OUTREG(AVIVO_D1GRPH_Y_END + radeon_crtc->crtc_offset, pScrn->virtualX);
+ break;
+
+ }
+ } else {
+ OUTREG(AVIVO_D1GRPH_X_END + radeon_crtc->crtc_offset, pScrn->virtualX);
+ OUTREG(AVIVO_D1GRPH_Y_END + radeon_crtc->crtc_offset, pScrn->virtualY);
}
OUTREG(AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, fb_location);
@@ -465,11 +482,6 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
OUTREG(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0);
OUTREG(AVIVO_D1GRPH_X_START + radeon_crtc->crtc_offset, 0);
OUTREG(AVIVO_D1GRPH_Y_START + radeon_crtc->crtc_offset, 0);
- if (crtc->rotatedData == NULL) {
- /* rotation changes the virtualX and virtualY */
- OUTREG(AVIVO_D1GRPH_X_END + radeon_crtc->crtc_offset, pScrn->virtualX);
- OUTREG(AVIVO_D1GRPH_Y_END + radeon_crtc->crtc_offset, pScrn->virtualY);
- }
OUTREG(AVIVO_D1GRPH_PITCH + radeon_crtc->crtc_offset,
crtc->scrn->displayWidth);
OUTREG(AVIVO_D1GRPH_ENABLE + radeon_crtc->crtc_offset, 1);