summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2010-02-24 22:46:28 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-02-26 14:50:53 -0500
commit2de0af5f5b806f9dbfdb1e9b6a5cf96d9433961d (patch)
treefe9f889c37439107cebac209847ec833540beafa /src/radeon_exa.c
parentc7e81d2f3a372e0d5f751dd0c5091aec2b56d936 (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_exa.c')
-rw-r--r--src/radeon_exa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 63ded940..217a0fef 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -401,7 +401,7 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height,
int padded_width;
uint32_t size;
uint32_t tiling = 0;
- int pixmap_align = 0;
+ int pixmap_align;
#ifdef EXA_MIXED_PIXMAPS
if (info->accel_state->exa->flags & EXA_MIXED_PIXMAPS) {
@@ -421,13 +421,13 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height,
}
if (tiling) {
- height = (height + 15) & ~15;
- pixmap_align = 255;
+ height = RADEON_ALIGN(height, 16);
+ pixmap_align = 256;
} else
- pixmap_align = 63;
+ pixmap_align = 64;
padded_width = ((width * bitsPerPixel + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
- padded_width = (padded_width + pixmap_align) & ~pixmap_align;
+ padded_width = RADEON_ALIGN(padded_width, pixmap_align);
size = height * padded_width;
new_priv = xcalloc(1, sizeof(struct radeon_exa_pixmap_priv));