summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-08-27 16:42:42 -0400
committerAdam Jackson <ajax@nwnk.net>2018-09-12 19:18:05 +0000
commitd791c8e5abc174ae589d954b0beb51d232f60019 (patch)
tree1f5a630cd30e743ba6963b51c3bfe4cc36b919a3 /hw/xfree86/common
parent3d06d111b272d495c2f12779097a3d9f1e632603 (diff)
dga: Make shutdown less magical and/or terrifying
DGAShutdown() walks every screen and attempts to reset the mode. That's maybe a reasonable thing to do, although the explicit loop is certainly a bad smell. In ddxGiveUp it's called after we've torn down the vga arbiter - and in fact most of the rest of screen state - which is... very very bad. The other place it's called is from the Control-Alt-BackSpace handler, where we don't even attempt to do vga arb setup, and where in any case we're going to escape the main loop eventually anyway. Move all that cleanup work inside DGACloseScreen. This means it happens earlier in server teardown than previously, but not in a way you're ever going to be upset about. Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/dgaproc.h1
-rw-r--r--hw/xfree86/common/xf86DGA.c23
-rw-r--r--hw/xfree86/common/xf86Events.c3
-rw-r--r--hw/xfree86/common/xf86Init.c7
4 files changed, 1 insertions, 33 deletions
diff --git a/hw/xfree86/common/dgaproc.h b/hw/xfree86/common/dgaproc.h
index 7925bd483..b9f003056 100644
--- a/hw/xfree86/common/dgaproc.h
+++ b/hw/xfree86/common/dgaproc.h
@@ -56,7 +56,6 @@ typedef struct {
extern Bool DGAScreenAvailable(ScreenPtr pScreen);
extern Bool DGAActive(int Index);
-extern void DGAShutdown(void);
extern Bool DGAVTSwitch(void);
extern Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index,
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index de805c4c0..fa70ba2f0 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -268,7 +268,7 @@ DGACloseScreen(ScreenPtr pScreen)
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
mieqSetHandler(ET_DGAEvent, NULL);
-
+ pScreenPriv->pScrn->SetDGAMode(pScreenPriv->pScrn, 0, NULL);
FreeMarkedVisuals(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
@@ -276,9 +276,6 @@ DGACloseScreen(ScreenPtr pScreen)
pScreen->InstallColormap = pScreenPriv->InstallColormap;
pScreen->UninstallColormap = pScreenPriv->UninstallColormap;
- /* DGAShutdown() should have ensured that no DGA
- screen were active by here */
-
free(pScreenPriv);
return ((*pScreen->CloseScreen) (pScreen));
@@ -576,24 +573,6 @@ DGAActive(int index)
return FALSE;
}
-/* Called by the event code in case the server is abruptly terminated */
-
-void
-DGAShutdown(void)
-{
- ScrnInfoPtr pScrn;
- int i;
-
- if (!DGAScreenKeyRegistered)
- return;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- pScrn = xf86Screens[i];
-
- (void) (*pScrn->SetDGAMode) (pScrn, 0, NULL);
- }
-}
-
/* Called by the extension to initialize a mode */
static int
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 455a0eccb..80676c669 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -166,9 +166,6 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
case ACTION_TERMINATE:
if (!xf86Info.dontZap) {
xf86Msg(X_INFO, "Server zapped. Shutting down.\n");
-#ifdef XFreeXDGA
- DGAShutdown();
-#endif
GiveUp(0);
}
break;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 8773a47e8..2ec15f027 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -57,9 +57,6 @@
#include "systemd-logind.h"
#include "loaderProcs.h"
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
#define XF86_OS_PRIVS
#include "xf86.h"
@@ -884,10 +881,6 @@ ddxGiveUp(enum ExitCode error)
xf86Screens[i]->vtSema = FALSE;
}
-#ifdef XFreeXDGA
- DGAShutdown();
-#endif
-
if (xorgHWOpenConsole)
xf86CloseConsole();