Revert "exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes"
This reverts commit ee798cf212.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
This commit is contained in:
parent
e48b1aaa97
commit
8b47b53226
|
|
@ -96,9 +96,10 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
|||
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
|
||||
|
||||
if (pExaPixmap->fb_pitch > 131071) {
|
||||
// don't need to protect from calling our own (wrapped) DestroyPixmap
|
||||
// handler, because it can deal with half-initialized state
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
if (pScreen->DestroyPixmap)
|
||||
pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -108,9 +109,10 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
|||
pScreen, pPixmap);
|
||||
|
||||
if (pExaPixmap->pDamage == NULL) {
|
||||
// don't need to protect from calling our own (wrapped) DestroyPixmap
|
||||
// handler, because it can deal with half-initialized state
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
if (pScreen->DestroyPixmap)
|
||||
pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -216,8 +218,6 @@ exaDestroyPixmap_classic(PixmapPtr pPixmap)
|
|||
|
||||
if (pPixmap->refcnt == 1) {
|
||||
ExaPixmapPriv(pPixmap);
|
||||
if (!pExaPixmap) // we're called on an error path
|
||||
goto out;
|
||||
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
|
|
@ -235,10 +235,9 @@ exaDestroyPixmap_classic(PixmapPtr pPixmap)
|
|||
RegionUninit(&pExaPixmap->validFB);
|
||||
}
|
||||
|
||||
out:
|
||||
// restore original (screen driver's) DestroyPixmap() handler and call it
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
if (pScreen->DestroyPixmap)
|
||||
ret = pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
|||
}
|
||||
|
||||
if (!pExaPixmap->driverPriv) {
|
||||
// don't need to protect from calling our own (wrapped) DestroyPixmap
|
||||
// handler, because it can deal with half-initialized state
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
if (pScreen->DestroyPixmap)
|
||||
pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -195,8 +196,6 @@ exaDestroyPixmap_driver(PixmapPtr pPixmap)
|
|||
|
||||
if (pPixmap->refcnt == 1) {
|
||||
ExaPixmapPriv(pPixmap);
|
||||
if (!pExaPixmap) // we're called on an error path
|
||||
goto out;
|
||||
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
|
|
@ -205,10 +204,9 @@ exaDestroyPixmap_driver(PixmapPtr pPixmap)
|
|||
pExaPixmap->driverPriv = NULL;
|
||||
}
|
||||
|
||||
out:
|
||||
// restore original (screen driver's) DestroyPixmap() handler and call it
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
if (pScreen->DestroyPixmap)
|
||||
ret = pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -249,8 +249,6 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
|
|||
|
||||
if (pPixmap->refcnt == 1) {
|
||||
ExaPixmapPriv(pPixmap);
|
||||
if (!pExaPixmap)
|
||||
goto out; // we're called on an error path
|
||||
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
|
|
@ -268,10 +266,9 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
|
|||
}
|
||||
}
|
||||
|
||||
out:
|
||||
// restore original (screen driver's) DestroyPixmap() handler and call it
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
if (pScreen->DestroyPixmap)
|
||||
ret = pScreen->DestroyPixmap(pPixmap);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue