summaryrefslogtreecommitdiff
path: root/src/radeon_exa_funcs.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_funcs.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_funcs.c')
-rw-r--r--src/radeon_exa_funcs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 91a1c75c..cdc0edb5 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -466,7 +466,7 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
uint32_t dst_domain;
uint32_t dst_pitch_offset;
unsigned bpp = pDst->drawable.bitsPerPixel;
- uint32_t scratch_pitch = (w * bpp / 8 + 63) & ~63;
+ uint32_t scratch_pitch = RADEON_ALIGN(w * bpp / 8, 64);
uint32_t swap = RADEON_HOST_DATA_SWAP_NONE;
Bool r;
int i;
@@ -565,7 +565,7 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
uint32_t src_domain = 0;
uint32_t src_pitch_offset;
unsigned bpp = pSrc->drawable.bitsPerPixel;
- uint32_t scratch_pitch = (w * bpp / 8 + 63) & ~63;
+ uint32_t scratch_pitch = RADEON_ALIGN(w * bpp / 8, 64);
uint32_t swap = RADEON_HOST_DATA_SWAP_NONE;
Bool r;
@@ -667,7 +667,7 @@ RADEONDownloadFromScreenCP(PixmapPtr pSrc, int x, int y, int w, int h,
RINFO_FROM_SCREEN(pSrc->drawable.pScreen);
uint8_t *src = info->FB + exaGetPixmapOffset(pSrc);
int bpp = pSrc->drawable.bitsPerPixel;
- uint32_t datatype, src_pitch_offset, scratch_pitch = (w * bpp/8 + 63) & ~63, scratch_off = 0;
+ uint32_t datatype, src_pitch_offset, scratch_pitch = RADEON_ALIGN(w * bpp / 8, 64), scratch_off = 0;
drmBufPtr scratch;
TRACE;