Call DRI2CloseScreen after pScreen->CloseScreen
Both DRI2 and RandR may wrap pScrn functions. Thus, it is important that
they get closed in the opposite order that they were initialized.
OMAPScreenInit() calls DRI2ScreenInit() before xf86CrtcScreenInit() (which
in turn calls xf86RandR12Init12).
Therefore, OMAPScreenCloseScreen() must unwrap xf86CrtcCloseScreen() and
call it (which in turn calls xf86RandR12CloseScreen) before calling
DRI2CloseScreen.
This should ensure that wrapped function order is correct between DRI2 and
RandR12.
In particular, this fixes the EnterVT handler such that it is correct on
subsequent server generations.
Cherry-Picked from:
https://chromium.googlesource.com/chromiumos%2Fthird_party%2Fxf86-video-armsoc
c5f79d00aa22fe7d0d2a7453f266a0f17539ebdd
Change-Id: I5665c3452a18bf2009640453f62dda0f33eb215f
diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c
index 41e43e8..7b99863 100644
--- a/src/armsoc_driver.c
+++ b/src/armsoc_driver.c
@@ -1058,11 +1058,18 @@
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn);
+ Bool ret;
TRACE_ENTER();
drmmode_screen_fini(pScrn);
+ unwrap(pARMSOC, pScreen, CloseScreen);
+ unwrap(pARMSOC, pScreen, BlockHandler);
+ unwrap(pARMSOC, pScreen, CreateScreenResources);
+
+ ret = (*pScreen->CloseScreen)(scrnIndex, pScreen);
+
if (pARMSOC->dri)
ARMSOCDRI2CloseScreen(pScreen);
@@ -1080,13 +1087,9 @@
pScrn->vtSema = FALSE;
- unwrap(pARMSOC, pScreen, CloseScreen);
- unwrap(pARMSOC, pScreen, BlockHandler);
- unwrap(pARMSOC, pScreen, CreateScreenResources);
-
TRACE_EXIT();
- return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ return ret;
}