summaryrefslogtreecommitdiff
path: root/exa/exa.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-08-05 18:39:47 +0200
committerMaarten Maathuis <madman2003@gmail.com>2009-08-06 23:48:14 +0200
commit3047bd067464efb9857960d3fa6324b947faa970 (patch)
treefefaab177a825139aa7c2cb58f28adeff240524e /exa/exa.c
parente8ac2ed5dc4c2ac0a5e1e1f371f94c15b1c729dd (diff)
exa: delay malloc for "mixed"
Diffstat (limited to 'exa/exa.c')
-rw-r--r--exa/exa.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 32a1c3ebc..c8fe12e9a 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -333,8 +333,18 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
- if (!offscreen)
+ if (!offscreen) {
+ /* Do we need to allocate our system buffer? */
+ if ((pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && (pExaScr->info->flags & EXA_MIXED_PIXMAPS)) {
+ if (!pExaPixmap->sys_ptr) {
+ pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch * pDrawable->height);
+ if (!pExaPixmap->sys_ptr)
+ FatalError("EXA: malloc failed for size %d bytes\n", pExaPixmap->sys_pitch * pDrawable->height);
+ pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
+ }
+ }
return FALSE;
+ }
exaWaitSync (pDrawable->pScreen);