diff options
author | Adam Jackson <ajax@freedesktop.org> | 2005-12-09 18:15:31 +0000 |
---|---|---|
committer | Adam Jackson <ajax@freedesktop.org> | 2005-12-09 18:15:31 +0000 |
commit | 8e115f2546aece7155ab266f725965830b9ad61d (patch) | |
tree | b859a05fa24c0f705472558303d0afe6f505861f | |
parent | 50d63ecb79fc0d80c7bdad239f90c6cca9d19bd6 (diff) |
Bug #1106: Fix memory allocation for Render. (Michel Daenzer)
-rw-r--r-- | src/radeon_render.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c index 191fb69..5f29157 100644 --- a/src/radeon_render.c +++ b/src/radeon_render.c @@ -281,11 +281,17 @@ AllocateLinear ( ScrnInfoPtr pScrn, int sizeNeeded ){ - RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONInfoPtr info = RADEONPTR(pScrn); + int cpp = info->CurrentLayout.bitsPerPixel / 8; info->RenderTimeout = currentTime.milliseconds + 30000; info->RenderCallback = RenderCallback; + /* XAA allocates in units of pixels at the screen bpp, so adjust size + * appropriately. + */ + sizeNeeded = (sizeNeeded + cpp - 1) / cpp; + if (info->RenderTex) { if (info->RenderTex->size >= sizeNeeded) return TRUE; |