mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-14 00:01:20 +00:00
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:
parent
962eddd7a2
commit
6c9d7ed61b
4 changed files with 76 additions and 50 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in a new issue