summaryrefslogtreecommitdiff
path: root/src/radeon_driver.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_driver.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_driver.c')
-rw-r--r--src/radeon_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8e852fce..4ed1c697 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4276,7 +4276,7 @@ void RADEONChangeSurfaces(ScrnInfoPtr pScrn)
int cpp = info->CurrentLayout.pixel_bytes;
/* depth/front/back pitch must be identical (and the same as displayWidth) */
int width_bytes = pScrn->displayWidth * cpp;
- int bufferSize = RADEON_ALIGN(((pScrn->virtualY + 15) & ~15) * width_bytes,
+ int bufferSize = RADEON_ALIGN((RADEON_ALIGN(pScrn->virtualY, 16)) * width_bytes,
RADEON_GPU_PAGE_SIZE);
unsigned int color_pattern, swap_pattern;
@@ -4309,7 +4309,7 @@ void RADEONChangeSurfaces(ScrnInfoPtr pScrn)
int retvalue;
int depthCpp = (info->dri->depthBits - 8) / 4;
int depth_width_bytes = pScrn->displayWidth * depthCpp;
- int depthBufferSize = RADEON_ALIGN(((pScrn->virtualY + 15) & ~15) * depth_width_bytes,
+ int depthBufferSize = RADEON_ALIGN((RADEON_ALIGN(pScrn->virtualY, 16)) * depth_width_bytes,
RADEON_GPU_PAGE_SIZE);
unsigned int depth_pattern;