From 8a39ec26146611d778d050a00034961c32f1f2a0 Mon Sep 17 00:00:00 2001 From: Paulo Ricardo Zanoni <pzanoni@mandriva.com> Date: Fri, 23 Oct 2009 13:33:42 -0200 Subject: [PATCH 904/908] Add noAutoDevices command line option --- hw/xfree86/common/xf86.h | 1 + hw/xfree86/common/xf86Config.c | 6 +++++- hw/xfree86/common/xf86Globals.c | 1 + hw/xfree86/common/xf86Init.c | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 54332e3..6e4fc2f 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -72,6 +72,7 @@ extern _X_EXPORT confDRIRec xf86ConfigDRI; extern _X_EXPORT Bool xf86DRI2Enabled(void); extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ +extern _X_EXPORT Bool xf86AutoAddDevices; #define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \ xf86ScreenKey)) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 49d8fa8..9ed95c8 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -831,7 +831,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.useSIGIO = FALSE; } - if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { + if (xf86AutoAddDevices == FALSE) { + xf86Info.autoAddDevices = FALSE; + from = X_CMDLINE; + } + else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); from = X_CONFIG; diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 16d5557..84ac29c 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -155,6 +155,7 @@ int xf86NumDrivers = 0; InputDriverPtr *xf86InputDriverList = NULL; int xf86NumInputDrivers = 0; int xf86NumScreens = 0; +Bool xf86AutoAddDevices = TRUE; const char *xf86VisualNames[] = { "StaticGray", diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index e664ce4..c27ff3d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1331,6 +1331,11 @@ ddxProcessArgument(int argc, char **argv, int i) xf86xkbdirFlag = TRUE; return 0; } + if (!strcmp(argv[i], "-noAutoAddDevices")) + { + xf86AutoAddDevices = FALSE; + return 1; + } /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); @@ -1387,6 +1392,7 @@ ddxUseMsg(void) ErrorF("-version show the server version\n"); ErrorF("-showDefaultModulePath show the server default module path\n"); ErrorF("-showDefaultLibPath show the server default library path\n"); + ErrorF("-noAutoAddDevices do not add devices through HAL events\n"); /* OS-specific usage */ xf86UseMsg(); ErrorF("\n"); -- 1.7.1