summaryrefslogtreecommitdiff
path: root/exa/exa_migration.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-31 19:41:28 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-31 19:41:28 +0000
commit2e38fedd29e7e55d01e3edce6a73b8ceaac17911 (patch)
tree3f6b1c560c62ff862cf6b07cc898804968159528 /exa/exa_migration.c
parentf480dc797b51f080f912efc7867d6d8e50be074c (diff)
Add an option to EXA for the DDX to request that EXA hide the pixmap's
devPrivate.ptr when pointing at offscreen memory, outside of exaPrepare/FinishAccess(). This was used with fakexa to find (by NULL dereference) many instances of un-Prepared CPU access to the framebuffer: - GC tiles used in several ops when fillStyle == FillTiled were never Prepared. - Migration could lead to un-Prepared access to mask data in render's Trapezoids and Triangles - PutImage's UploadToScreen failure fallback failed to Prepare.
Diffstat (limited to 'exa/exa_migration.c')
-rw-r--r--exa/exa_migration.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index e7c180219..50700ed46 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -190,7 +190,7 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
pPixmap->drawable.width,
pPixmap->drawable.height));
- if (pPixmap->devPrivate.ptr == pExaPixmap->fb_ptr) {
+ if (exaPixmapIsOffscreen(pPixmap)) {
exaCopyDirtyToSys (pPixmap);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
@@ -233,7 +233,7 @@ exaMoveInPixmap (PixmapPtr pPixmap)
return;
/* If we're already in FB, our work is done. */
- if (pPixmap->devPrivate.ptr == pExaPixmap->fb_ptr)
+ if (exaPixmapIsOffscreen(pPixmap))
return;
/* If we're not allowed to move, then fail. */
@@ -267,7 +267,10 @@ exaMoveInPixmap (PixmapPtr pPixmap)
exaCopyDirtyToFb (pPixmap);
- pPixmap->devPrivate.ptr = (pointer) pExaPixmap->fb_ptr;
+ if (pExaScr->hideOffscreenPixmapData)
+ pPixmap->devPrivate.ptr = NULL;
+ else
+ pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
}
@@ -291,7 +294,7 @@ exaMoveOutPixmap (PixmapPtr pPixmap)
pPixmap->drawable.width,
pPixmap->drawable.height));
- if (pPixmap->devPrivate.ptr == pExaPixmap->fb_ptr) {
+ if (exaPixmapIsOffscreen(pPixmap)) {
exaCopyDirtyToSys (pPixmap);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;