xserver: Branch 'master' - 2 commits

Peter Hutterer whot at kemper.freedesktop.org
Wed Sep 16 18:41:54 PDT 2009


 configure.ac                         |   53 +++++++++++++++++++++++++++++++----
 hw/xfree86/common/xf86Config.c       |   19 ++++++++++++
 hw/xfree86/common/xf86Helper.c       |    2 -
 hw/xfree86/common/xf86Privstr.h      |    2 +
 hw/xfree86/doc/man/xorg.conf.man.pre |    9 +++++
 hw/xfree86/os-support/shared/sigio.c |    6 +++
 include/xorg-config.h.in             |    3 +
 7 files changed, 87 insertions(+), 7 deletions(-)

New commits:
commit 715953bf5c00b4605dd6ab45c92140c0e81174ee
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Tue Sep 15 21:13:00 2009 -0700

    Check for -wrap support in the linker
    
    Allows unit tests to be built with non-gnu-linkers that
    also have -wrap support
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index f13ec5c..8983697 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1173,20 +1173,45 @@ if test "x$DEBUGGING" = xyes; then
 fi
 AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
 
+# If unittests aren't explicitly disabled, check for required support
+if test "x$UNITTESTS" != xno ; then
+       PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
+                         [HAVE_GLIB=yes], [HAVE_GLIB=no])
+
+       # Check if linker supports -wrap, passed via compiler flags
+       # When cross-compiling, reports no, since unit tests run from
+       # "make check", so would be running on build machine,  not target
+       AC_MSG_CHECKING([whether the linker supports -wrap])
+       save_LDFLAGS="$LDFLAGS"
+       LDFLAGS="$LDFLAGS -Wl,-wrap,exit"
+       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+	void __wrap_exit (int s)
+	{
+	    __real_exit (0);
+	}]],
+	[[exit (1);]])],
+                     [linker_can_wrap="yes"],
+                     [linker_can_wrap="no"],
+                     [linker_can_wrap="no"])
+       AC_MSG_RESULT([$linker_can_wrap])
+       LDFLAGS="$save_LDFLAGS"
+fi
+
 if test "x$UNITTESTS" = xauto; then
-       PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16], [HAVE_GLIB=yes], [HAVE_GLIB=no])
-       if test "x$HAVE_GLIB" = xyes && test "x$with_gnu_ld" = xyes; then
+       if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then
            UNITTESTS=yes
        else
            UNITTESTS=no
        fi
 fi
 if test "x$UNITTESTS" = xyes; then
-       AC_DEFINE(UNITTESTS, 1, [Enable unit tests])
-       PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16])
-       if test "x$with_gnu_ld" = xno; then
-           AC_MSG_ERROR([GNU ld required to build unit tests])
+       if test "x$HAVE_GLIB" = xno; then
+           AC_MSG_ERROR([glib required to build unit tests])
        fi
+       if test "x$linker_can_wrap" = xno; then
+           AC_MSG_ERROR([ld -wrap support required to build unit tests])
+       fi
+       AC_DEFINE(UNITTESTS, 1, [Enable unit tests])
        AC_SUBST([GLIB_LIBS])
        AC_SUBST([GLIB_CFLAGS])
 fi
commit e2c64551808988657069006f74c6780973ec0557
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Tue Sep 15 21:13:48 2009 -0700

    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 at sun.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index f6b91cd..f13ec5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -379,6 +379,7 @@ AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
 AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
 
 DRI=no
+USE_SIGIO_BY_DEFAULT="yes"
 dnl it would be nice to autodetect these *CONS_SUPPORTs
 case $host_os in
   *freebsd* | *dragonfly*)
@@ -408,6 +409,9 @@ case $host_os in
 	;;
   *solaris*)
 	PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
+	# Disable use of SIGIO by default until some system bugs are
+	# fixed - see Sun/OpenSolaris bug id 6879897
+	USE_SIGIO_BY_DEFAULT="no"
 	;;
   darwin*)
 	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
@@ -442,6 +446,9 @@ AC_ARG_ENABLE(debug,         AS_HELP_STRING([--enable-debug],
 AC_ARG_ENABLE(unit-tests,    AS_HELP_STRING([--enable-unit-tests],
                                   [Enable unit-tests (default: auto)]),
                                 [UNITTESTS=$enableval], [UNITTESTS=auto])
+AC_ARG_ENABLE(sigio-default, AS_HELP_STRING([--enable-use-sigio-by-default]
+  [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]),
+                                [USE_SIGIO_BY_DEFAULT=$enableval], [])
 AC_ARG_WITH(int10,           AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
 				[INT10="$withval"],
 				[INT10="$DEFAULT_INT10"])
@@ -485,6 +492,7 @@ esac
 AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
 				[ FONTPATH="$withval" ],
 				[ FONTPATH="${DEFAULT_FONT_PATH}" ])
+
 AC_ARG_WITH(xkb-path,         AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
 				[ XKBPATH="$withval" ],
 				[ XKBPATH="${datadir}/X11/xkb" ])
@@ -756,6 +764,14 @@ fi
 AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
 CONFIG_LIB='$(top_builddir)/config/libconfig.la'
 
+if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
+	USE_SIGIO_BY_DEFAULT_VALUE=TRUE
+else
+	USE_SIGIO_BY_DEFAULT_VALUE=FALSE
+fi
+AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE],
+		   [Use SIGIO handlers for input device events by default])
+
 AC_MSG_CHECKING([for glibc...])
 AC_PREPROC_IFELSE([
 #include <features.h>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 82c3993..0605f37 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 9a2468d..56ab266 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 26f822d..9982601 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 35f3687..e3cbcf5 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 44136cc..aed5654 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;
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index d159420..794de7a 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -130,4 +130,7 @@
 /* Path to text files containing PCI IDs */
 #undef PCI_TXT_IDS_PATH
 
+/* Use SIGIO handlers for input device events by default */
+#undef USE_SIGIO_BY_DEFAULT
+
 #endif /* _XORG_CONFIG_H_ */


More information about the xorg-commit mailing list