summaryrefslogtreecommitdiff
path: root/exa/exa.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-03-19 19:07:59 +0100
committerMaarten Maathuis <madman2003@gmail.com>2009-03-19 20:40:03 +0100
commit12aeddf5ad41902a180f8108623f356642b3e911 (patch)
treeaeb3917373cf8982c516fc1e994d7df59b8fe4e5 /exa/exa.c
parenta635bb5357648779815ec6729d55f6b478493213 (diff)
exa: Accept scratch pixmaps with offscreen memory as such.
Diffstat (limited to 'exa/exa.c')
-rw-r--r--exa/exa.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/exa/exa.c b/exa/exa.c
index ecb2117cf..10abf06c9 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -427,11 +427,19 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
if (devKind > 0)
pExaPixmap->sys_pitch = devKind;
- /* Is this the framebuffer (for classic exa)? */
- if (pPixData && pPixData == pExaScr->info->memoryBase) {
- pExaPixmap->fb_ptr = pPixData;
- pExaPixmap->fb_pitch = devKind;
- pExaPixmap->offscreen = TRUE;
+ /* Classic EXA:
+ * - Framebuffer.
+ * - Scratch pixmap with offscreen memory.
+ */
+ if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) &&
+ pExaScr->info->memoryBase && pPixData) {
+ if ((CARD8 *)pPixData >= pExaScr->info->memoryBase &&
+ ((CARD8 *)pPixData - pExaScr->info->memoryBase) <
+ pExaScr->info->memorySize) {
+ pExaPixmap->fb_ptr = pPixData;
+ pExaPixmap->fb_pitch = devKind;
+ pExaPixmap->offscreen = TRUE;
+ }
}
if (width > 0 && height > 0 && bitsPerPixel > 0) {