summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-12-17 11:10:14 +1000
committerDave Airlie <airlied@redhat.com>2007-12-17 11:10:14 +1000
commit614414611a9f246cbc74f579a79987fff97cf571 (patch)
treeb3f0f1ed68b1232f8e1c06dc64a5d2bf80079b8f
parent79a375dbc7f323e2f551490a35f44ec36bed877c (diff)
radeon: cleanup pitch calculation and make r600 work again
-rw-r--r--src/radeon_modes.c14
1 files changed, 8 insertions, 6 deletions
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;