From 2de0af5f5b806f9dbfdb1e9b6a5cf96d9433961d Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 24 Feb 2010 22:46:28 -0500 Subject: 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 CC: Alex Deucher CC: Dave Airlie Signed-off-by: Matt Turner --- src/radeon_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/radeon_driver.c') 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; -- cgit v1.2.3