From bc4c7c4785bea9839abbeac1a23bc8e35ff09662 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira <ander@mandriva.com.br> Date: Wed, 28 Jan 2009 13:39:02 -0200 Subject: [PATCH 907/907] Add noAutoAddDevices 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 a32aa9b..15d67a3 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -73,6 +73,7 @@ extern Bool sbusSlotClaimed; extern confDRIRec xf86ConfigDRI; extern Bool xf86inSuspend; extern Bool xf86DRI2Enabled(void); +extern 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 17223a1..e94d7b0 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -854,7 +854,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } - 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 04a96cb..0900c7d 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -160,6 +160,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 2493526..0353269 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1861,6 +1861,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); @@ -1917,6 +1922,7 @@ ddxUseMsg() 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.6.1.3