mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-20 20:12:21 +00:00
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.
This commit is contained in:
parent
f480dc797b
commit
2e38fedd29
9 changed files with 275 additions and 59 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue