summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-05-02 08:33:21 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2015-01-14 14:45:16 +1000
commit547bf69d71a122f1339c0c251ff88901535b0cd3 (patch)
tree054190fdd8bb225e28afb96a69f336dc95b1d772
parent2ee096821fcba42212660c72d16791fb08457efc (diff)
xfree86: consolidate initial init and reset branches in InitOutput
The InitOutput function has a large if/else block for managing initial initialization versus regeneration. This commit combines the two branches to reduce duplication of code and to make it easier to write future changes for supporting socket activated X server Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xfree86/common/xf86Init.c67
1 files changed, 28 insertions, 39 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 1494aac09..62e15e54f 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -386,7 +386,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
Bool pix24Fail = FALSE;
Bool autoconfig = FALSE;
Bool sigio_blocked = FALSE;
- Bool want_hw_access = FALSE;
+ Bool want_hw_access = xorgHWAccess;
GDevPtr configured_device;
xf86Initialising = TRUE;
@@ -439,10 +439,12 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (xf86DoShowOptions)
DoShowOptions();
+ }
- dbus_core_init();
- systemd_logind_init();
+ dbus_core_init();
+ systemd_logind_init();
+ if (serverGeneration == 1) {
/* Do a general bus probe. This will be a PCI probe for x86 platforms */
xf86BusProbe();
@@ -455,11 +457,22 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
return;
}
}
+ }
#ifdef XF86PM
- xf86OSPMClose = xf86OSPMOpen();
+ /*
+ should we reopen it here? We need to deal with an already opened
+ device. We could leave this to the OS layer. For now we simply
+ close it here
+ */
+ if (xf86OSPMClose)
+ xf86OSPMClose();
+
+ if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
+ xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
#endif
+ if (serverGeneration == 1) {
xf86ExtensionInit();
/* Load all modules specified explicitly in the config file */
@@ -535,19 +548,21 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (!(flags & HW_SKIP_CONSOLE) && !ServerIsNotSeat0())
xorgHWOpenConsole = TRUE;
}
+ }
- if (xorgHWOpenConsole)
- xf86OpenConsole();
- else
- xf86Info.dontVTSwitch = TRUE;
+ if (xorgHWOpenConsole)
+ xf86OpenConsole();
+ else
+ xf86Info.dontVTSwitch = TRUE;
- /* Enable full I/O access */
- if (want_hw_access)
- xorgHWAccess = xf86EnableIO();
+ /* Enable full I/O access */
+ if (want_hw_access)
+ xorgHWAccess = xf86EnableIO();
- if (xf86BusConfig() == FALSE)
- return;
+ if (xf86BusConfig() == FALSE)
+ return;
+ if (serverGeneration == 1) {
xf86PostProbe();
/*
@@ -777,32 +792,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
}
}
}
- else {
- dbus_core_init();
- systemd_logind_init();
-
- /*
- * serverGeneration != 1; some OSs have to do things here, too.
- */
- if (xorgHWOpenConsole)
- xf86OpenConsole();
-
-#ifdef XF86PM
- /*
- should we reopen it here? We need to deal with an already opened
- device. We could leave this to the OS layer. For now we simply
- close it here
- */
- if (xf86OSPMClose)
- xf86OSPMClose();
- if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
- xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
-#endif
-
- /* Make sure full I/O access is enabled */
- if (xorgHWAccess)
- xf86EnableIO();
- }
/*
* Use the previously collected parts to setup pScreenInfo