summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-12-09 18:15:31 +0000
committerAdam Jackson <ajax@nwnk.net>2005-12-09 18:15:31 +0000
commit03961a05438e916b6725f4e547f23a84ead13c5e (patch)
tree3b67c3ea9cfe9da8879dd0339349a28f334fcaa9
parent091e5c584124f9b849c0f46802b2f0d8b0cc2388 (diff)
Bug #1106: Fix memory allocation for Render. (Michel Daenzer)
-rw-r--r--src/radeon_render.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c
index 191fb693..5f29157f 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;