xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Mon May 30 07:18:04 UTC 2016


 dix/globals.c                        |    9 ---------
 hw/xfree86/common/xf86.h             |    4 ++++
 hw/xfree86/os-support/shared/sigio.c |   10 +++++-----
 3 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 28b2c880a9dbfd91e82397a0f22482d258a8b670
Author: Keith Packard <keithp at keithp.com>
Date:   Sun May 29 19:11:50 2016 -0700

    xfree86: Provide xf86BlockSIGIO and xf86ReleaseSIGIO as wrappers for input mutex
    
    Threaded input doesn't use SIGIO anymore, but existing drivers using
    xf86BlockSIGIO and xf86ReleaseSIGIO probably want to lock the input
    mutex during those operations. Provide inline functions to do this
    which are marked as 'deprecated' so that drivers will get warnings
    until they are changed.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index adb5601..e54c811 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -93,6 +93,10 @@ extern _X_EXPORT Bool VTSwitchEnabled;  /* kbd driver */
 #define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
 			(((p) == Pix24Use32) ? 32 : 0))
 
+/* Compatibility functions for pre-input-thread drivers */
+static inline _X_DEPRECATED int xf86BlockSIGIO(void) { input_lock(); return 0; }
+static inline _X_DEPRECATED void xf86UnblockSIGIO(int wasset) { input_unlock(); }
+
 /* Function Prototypes */
 #ifndef _NO_XF86_PROTOTYPES
 
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 37d35f7..37ef38f 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -131,7 +131,7 @@ xf86IsPipe(int fd)
 }
 
 static void
-xf86BlockSIGIO(void)
+block_sigio(void)
 {
     sigset_t set;
 
@@ -141,7 +141,7 @@ xf86BlockSIGIO(void)
 }
 
 static void
-xf86ReleaseSIGIO(void)
+release_sigio(void)
 {
     sigset_t set;
 
@@ -165,7 +165,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
         if (!xf86SigIOFuncs[i].f) {
             if (xf86IsPipe(fd))
                 return 0;
-            xf86BlockSIGIO();
+            block_sigio();
 #ifdef O_ASYNC
             if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
                 xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
@@ -193,7 +193,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
             }
 #endif
             if (!installed) {
-                xf86ReleaseSIGIO();
+                release_sigio();
                 return 0;
             }
             sigemptyset(&sa.sa_mask);
@@ -209,7 +209,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
             if (fd >= xf86SigIOMaxFd)
                 xf86SigIOMaxFd = fd + 1;
             FD_SET(fd, &xf86SigIOMask);
-            xf86ReleaseSIGIO();
+            release_sigio();
             return 1;
         }
         /* Allow overwriting of the closure and callback */
commit 2bed654be7001407ae65f7128440340fd3c1f083
Author: Keith Packard <keithp at keithp.com>
Date:   Sun May 29 19:05:13 2016 -0700

    dix: Remove bogus input_mutex and input_mutex_count definitions from globals.c
    
    These are local to inputthread.c; the ones in globals.c aren't
    declared in any header file.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/globals.c b/dix/globals.c
index e313930..f36a938 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -132,12 +132,3 @@ Bool explicit_display = FALSE;
 char *ConnectionInfo;
 
 CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
-
-#if DEBUG_INPUT_MUTEX
-#define INPUT_MUTEX_INITIALIZER PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-#else
-#define INPUT_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#endif
-
-pthread_mutex_t input_mutex = INPUT_MUTEX_INITIALIZER;
-__thread int input_mutex_count;


More information about the xorg-commit mailing list