xf86-video-ati: Branch 'atombios-support'

Dave Airlie airlied at kemper.freedesktop.org
Sun Dec 16 17:11:37 PST 2007


 src/radeon_modes.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 614414611a9f246cbc74f579a79987fff97cf571
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Dec 17 11:10:14 2007 +1000

    radeon: cleanup pitch calculation and make r600 work again

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 21fb659..c9e99b8 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -59,20 +59,22 @@ void RADEONSetPitch (ScrnInfoPtr pScrn)
 {
     int  dummy = pScrn->virtualX;
     RADEONInfoPtr info = RADEONPTR(pScrn);
+    int pitch_mask = 0;
+    int align_large;
+
+    align_large = info->allowColorTiling || IS_AVIVO_VARIANT;
 
     /* FIXME: May need to validate line pitch here */
     switch (pScrn->depth / 8) {
-    case 1: if (info->allowColorTiling) dummy = (pScrn->virtualX + 255) & ~255;
-	else dummy = (pScrn->virtualX + 127) & ~127;
+    case 1: pitch_mask = align_large ? 255 : 127;
 	break;
-    case 2: if (info->allowColorTiling) dummy = (pScrn->virtualX + 127) & ~127;
-	else dummy = (pScrn->virtualX + 31) & ~31;
+    case 2: pitch_mask = align_large ? 127 : 31;
 	break;
     case 3:
-    case 4: if (info->allowColorTiling) dummy = (pScrn->virtualX + 63) & ~63;
-	else dummy = (pScrn->virtualX + 15) & ~15;
+    case 4: pitch_mask = align_large ? 63 : 15;
 	break;
     }
+    dummy = (pScrn->virtualX + pitch_mask) & ~pitch_mask;
     pScrn->displayWidth = dummy;
     info->CurrentLayout.displayWidth = pScrn->displayWidth;
 


More information about the xorg-commit mailing list