EXA: Finish access to pixmap if it's prepared at destruction time.
Previously we assumed every pixmap destroyed during a software fallback was also created during a software fallback and had access prepared, but that's not always true. Fixes a server abort Reported-by: 邓逸昕 <bupt.dengyixin@gmail.com> Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d75e8146c4
commit
0540c46066
23
exa/exa.c
23
exa/exa.c
|
@ -435,6 +435,29 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
|
|||
(*pExaScr->info->FinishAccess) (pPixmap, i);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper for things common to all schemes when a pixmap is destroyed
|
||||
*/
|
||||
void
|
||||
exaDestroyPixmap(PixmapPtr pPixmap)
|
||||
{
|
||||
ExaScreenPriv(pPixmap->drawable.pScreen);
|
||||
int i;
|
||||
|
||||
/* Finish access if it was prepared (e.g. pixmap created during
|
||||
* software fallback)
|
||||
*/
|
||||
for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
|
||||
if (pExaScr->access[i].pixmap == pPixmap) {
|
||||
exaFinishAccess(&pPixmap->drawable, i);
|
||||
pExaScr->access[i].pixmap = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Here begins EXA's GC code.
|
||||
* Do not ever access the fb/mi layer directly.
|
||||
|
|
|
@ -221,9 +221,7 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
|
|||
{
|
||||
ExaPixmapPriv (pPixmap);
|
||||
|
||||
/* During a fallback we must finish access, but we don't know the index. */
|
||||
if (pExaScr->fallback_counter)
|
||||
exaFinishAccess(&pPixmap->drawable, -1);
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
if (pExaPixmap->area)
|
||||
{
|
||||
|
|
|
@ -193,9 +193,7 @@ exaDestroyPixmap_driver (PixmapPtr pPixmap)
|
|||
{
|
||||
ExaPixmapPriv (pPixmap);
|
||||
|
||||
/* During a fallback we must finish access, but we don't know the index. */
|
||||
if (pExaScr->fallback_counter)
|
||||
exaFinishAccess(&pPixmap->drawable, -1);
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
if (pExaPixmap->driverPriv)
|
||||
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
|
||||
|
|
|
@ -245,9 +245,7 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
|
|||
{
|
||||
ExaPixmapPriv (pPixmap);
|
||||
|
||||
/* During a fallback we must finish access, but we don't know the index. */
|
||||
if (pExaScr->fallback_counter)
|
||||
exaFinishAccess(&pPixmap->drawable, -1);
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
if (pExaScr->deferred_mixed_pixmap == pPixmap)
|
||||
pExaScr->deferred_mixed_pixmap = NULL;
|
||||
|
|
|
@ -550,6 +550,9 @@ exaPrepareAccess(DrawablePtr pDrawable, int index);
|
|||
void
|
||||
exaFinishAccess(DrawablePtr pDrawable, int index);
|
||||
|
||||
void
|
||||
exaDestroyPixmap(PixmapPtr pPixmap);
|
||||
|
||||
void
|
||||
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
|
||||
|
||||
|
|
Loading…
Reference in New Issue