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/r600_exa.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/r600_exa.c')
-rw-r--r-- | src/r600_exa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c index 5ed9c07f..6fed720d 100644 --- a/src/r600_exa.c +++ b/src/r600_exa.c @@ -1916,7 +1916,7 @@ R600CopyToVRAM(ScrnInfoPtr pScrn, RADEONInfoPtr info = RADEONPTR(pScrn); uint32_t scratch_mc_addr; int wpass = w * (bpp/8); - int scratch_pitch_bytes = (wpass + 255) & ~255; + int scratch_pitch_bytes = RADEON_ALIGN(wpass, 256); uint32_t scratch_pitch = scratch_pitch_bytes / (bpp / 8); int scratch_offset = 0, hpass, temph; char *dst; @@ -2008,7 +2008,7 @@ R600DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, uint32_t src_height = pSrc->drawable.height; int bpp = pSrc->drawable.bitsPerPixel; uint32_t scratch_mc_addr; - int scratch_pitch_bytes = (dst_pitch + 255) & ~255; + int scratch_pitch_bytes = RADEON_ALIGN(dst_pitch, 256); int scratch_offset = 0, hpass; uint32_t scratch_pitch = scratch_pitch_bytes / (bpp / 8); int wpass = w * (bpp/8); @@ -2089,7 +2089,7 @@ R600UploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h, unsigned size; uint32_t dst_domain; int bpp = pDst->drawable.bitsPerPixel; - uint32_t scratch_pitch = (w * bpp / 8 + 255) & ~255; + uint32_t scratch_pitch = RADEON_ALIGN(w * bpp / 8, 256); uint32_t src_pitch_hw = scratch_pitch / (bpp / 8); uint32_t dst_pitch_hw = exaGetPixmapPitch(pDst) / (bpp / 8); Bool r; @@ -2163,7 +2163,7 @@ R600DownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w, unsigned size; uint32_t src_domain = 0; int bpp = pSrc->drawable.bitsPerPixel; - uint32_t scratch_pitch = (w * bpp / 8 + 255) & ~255; + uint32_t scratch_pitch = RADEON_ALIGN(w * bpp / 8, 256); uint32_t dst_pitch_hw = scratch_pitch / (bpp / 8); uint32_t src_pitch_hw = exaGetPixmapPitch(pSrc) / (bpp / 8); Bool r; |