EXA: Hide pixmap pointer outside of exaPrepare/FinishAccess whenever possible.

We finally want to catch all cases where the pixmap pointer is dereferenced
outside of exaPrepare/FinishAccess.

Also fix a couple of such cases exposed by this change.
This commit is contained in:
Michel Dänzer 2007-09-06 13:10:16 +02:00
commit 6c9d7ed61b
4 changed files with 76 additions and 50 deletions

View file

@ -213,8 +213,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int dstXoff, dstYoff;
if (!access_prepared) {
exaPrepareAccessReg(pDrawable, EXA_PREPARE_DEST,
pixmaps[0].pReg);
ExaDoPrepareAccess(pDrawable, EXA_PREPARE_DEST);
access_prepared = TRUE;
}
@ -233,14 +232,14 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
GXcopy, FB_ALLONES, dstBpp);
}
if (access_prepared)
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
else
exaMarkSync(pDrawable->pScreen);
exaPixmapDirty(pixmaps[0].pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
}
if (access_prepared)
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
else
exaMarkSync(pDrawable->pScreen);
return TRUE;
fallback:
@ -271,8 +270,10 @@ exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
src_stride))
return;
exaPrepareAccess(pDrawable, EXA_PREPARE_DEST);
fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
data);
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
}
ShmFuncs exaShmFuncs = { NULL, exaShmPutImage };