diff options
author | Matt Turner <mattst88@gmail.com> | 2010-02-24 22:46:28 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2010-02-26 14:50:53 -0500 |
commit | 2de0af5f5b806f9dbfdb1e9b6a5cf96d9433961d (patch) | |
tree | fe9f889c37439107cebac209847ec833540beafa /src/radeon_modes.c | |
parent | c7e81d2f3a372e0d5f751dd0c5091aec2b56d936 (diff) |
Use RADEON_ALIGN instead of open coding it.
Also fix some RADEON_ALIGN(x, 63), which would return incorrect results
for odd x. Though this shouldn't happen, it's still not right. You
wouldn't ever write (x + 62) & ~62 which is clearly wrong (and what it
expands to).
CC: Jerome Glisse <jglisse@redhat.com>
CC: Alex Deucher <alexdeucher@gmail.com>
CC: Dave Airlie <airlied@redhat.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/radeon_modes.c')
-rw-r--r-- | src/radeon_modes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/radeon_modes.c b/src/radeon_modes.c index e440b59b..d5635c96 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -67,18 +67,18 @@ void RADEONSetPitch (ScrnInfoPtr pScrn) /* FIXME: May need to validate line pitch here */ if (info->ChipFamily < CHIP_FAMILY_R600) { switch (pScrn->depth / 8) { - case 1: pitch_mask = align_large ? 255 : 127; + case 1: pitch_mask = align_large ? 256 : 128; break; - case 2: pitch_mask = align_large ? 127 : 31; + case 2: pitch_mask = align_large ? 128 : 32; break; case 3: - case 4: pitch_mask = align_large ? 63 : 15; + case 4: pitch_mask = align_large ? 64 : 16; break; } } else - pitch_mask = 255; /* r6xx/r7xx need 256B alignment for accel */ + pitch_mask = 256; /* r6xx/r7xx need 256B alignment for accel */ - dummy = (pScrn->virtualX + pitch_mask) & ~pitch_mask; + dummy = RADEON_ALIGN(pScrn->virtualX, pitch_mask); pScrn->displayWidth = dummy; info->CurrentLayout.displayWidth = pScrn->displayWidth; |