diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-09-15 21:13:48 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-17 10:06:37 +1000 |
commit | e2c64551808988657069006f74c6780973ec0557 (patch) | |
tree | a00b876f259518ffb98de17172d50a7fdbecf988 /hw/xfree86 | |
parent | 3bdf36476179257561b9409c3f49a77640fbb9f9 (diff) |
Add configuration option for use of SIGIO handlers for input events
Boolean option to enable/disable SIGIO handlers is set by the first
of these found:
- UseSIGIO option is set in xorg.conf ServerFlags
- Default set at build time by ./configure --enable-use-sigio-by-default
- Platform default value: Solaris = no, all others = yes
This matches the current settings on all platforms except Solaris.
This reverts Solaris (for now) to the settings used in Xorg 1.6, before
SIGIO support for Solaris was added, due to some system level bugs that
won't be resolved in time for Xorg 1.7 release, but allows us to enable
when those are resolved (or when we need to test if they're resolved).
See http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6879897
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 19 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Helper.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Privstr.h | 2 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 9 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigio.c | 6 |
5 files changed, 37 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 82c39939e..0605f37e0 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -708,6 +708,7 @@ typedef enum { FLAG_AUTO_ENABLE_DEVICES, FLAG_GLX_VISUALS, FLAG_DRI2, + FLAG_USE_SIGIO } FlagValues; static OptionInfoRec FlagOptions[] = { @@ -765,6 +766,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_DRI2, "DRI2", OPTV_BOOLEAN, {0}, FALSE }, + { FLAG_USE_SIGIO, "UseSIGIO", OPTV_BOOLEAN, + {0}, USE_SIGIO_BY_DEFAULT }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -832,6 +835,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } + if (xf86SIGIOSupported()) { + xf86GetOptValBool(FlagOptions, FLAG_USE_SIGIO, &xf86Info.useSIGIO); + if (xf86IsOptionSet(FlagOptions, FLAG_USE_SIGIO)) { + from = X_CONFIG; + } else { + from = X_DEFAULT; + } + if (!xf86Info.useSIGIO) { + xf86Msg(from, "Disabling SIGIO handlers for input devices\n"); + } else if (from == X_CONFIG) { + xf86Msg(from, "Enabling SIGIO handlers for input devices\n"); + } + } else { + xf86Info.useSIGIO = FALSE; + } + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 9a2468dd3..56ab266ae 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -2312,7 +2312,7 @@ xf86SetSilkenMouse (ScreenPtr pScreen) * yet. Should handle this differently so that alternate async methods * work correctly with this too. */ - pScrn->silkenMouse = useSM && xf86SIGIOSupported(); + pScrn->silkenMouse = useSM && xf86Info.useSIGIO && xf86SIGIOSupported(); if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n", pScrn->silkenMouse ? "enabled" : "disabled"); diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 26f822dc4..998260142 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -87,6 +87,8 @@ typedef struct { Bool miscModInDevEnabled; /* Allow input devices to be * changed */ Bool miscModInDevAllowNonLocal; + Bool useSIGIO; /* Use SIGIO for handling + input device events */ Pix24Flags pixmap24; MessageType pix24From; #ifdef __i386__ diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 35f368734..e3cbcf586 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -450,6 +450,15 @@ core file. In general you never want to use this option unless you are debugging an __xservername__ server problem and know how to deal with the consequences. .TP 7 +.BI "Option \*qUseSIGIO\*q \*q" boolean \*q +This controls whether the __xservername__ server requests that events from +input devices be reported via a SIGIO signal handler (also known as SIGPOLL +on some platforms), or only reported via the standard select(3) loop. +The default behaviour is platform specific. In general you do not want to +use this option unless you are debugging the __xservername__ server, or +working around a specific bug until it is fixed, and understand the +consequences. +.TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the .BI Ctrl+Alt+F n diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index 44136ccfb..aed5654e8 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -145,6 +145,9 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure) int blocked; int installed = FALSE; + if (!xf86Info.useSIGIO) + return 0; + for (i = 0; i < MAX_FUNCS; i++) { if (!xf86SigIOFuncs[i].f) @@ -216,6 +219,9 @@ xf86RemoveSIGIOHandler(int fd) int maxfd; int ret; + if (!xf86Info.useSIGIO) + return 0; + max = 0; maxfd = -1; ret = 0; |