configure.ac   |    2 +-
 src/emuMB.c    |   21 ++++++++++++---------
 src/emuThird.c |   13 ++++++++++---
 src/evdev.c    |    5 ++++-
 src/evdev.h    |   16 ++++++++++++++--
 5 files changed, 41 insertions(+), 16 deletions(-)

New commits:
commit 551db5b86e2a19e027e57571b8e5405dacb8bd67
Author: Peter Hutterer <peter.hutte...@who-t.net>
Date:   Sat Oct 1 17:48:30 2016 +1000

    evdev 2.10.4
    
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

diff --git a/configure.ac b/configure.ac
index 920154d..e4887a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-evdev],
-        [2.10.3],
+        [2.10.4],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-evdev])
 AC_CONFIG_SRCDIR([Makefile.am])

commit bb8bde7456def4186f9a4a0a9f98d53c949e1450
Author: Keith Packard <kei...@keithp.com>
Date:   Tue May 31 17:52:43 2016 -0700

    Support XINPUT ABI 24 (remove select mask from block/wakeup handlers)
    
    The evdev driver wasn't using the select mask arguments, so this
    change just involves adjusting the argument lists.
    
    Signed-off-by: Keith Packard <kei...@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

diff --git a/src/emuMB.c b/src/emuMB.c
index 94e50c4..d1777aa 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -268,9 +268,7 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL 
press)
 }
 
 
-void EvdevMBEmuWakeupHandler(pointer data,
-                             int i,
-                             pointer LastSelectMask)
+void EvdevMBEmuWakeupHandler(WAKEUP_HANDLER_ARGS)
 {
     InputInfoPtr pInfo = (InputInfoPtr)data;
     EvdevPtr     pEvdev = (EvdevPtr)pInfo->private;
@@ -284,9 +282,7 @@ void EvdevMBEmuWakeupHandler(pointer data,
     }
 }
 
-void EvdevMBEmuBlockHandler(pointer data,
-                            struct timeval **waitTime,
-                            pointer LastSelectMask)
+void EvdevMBEmuBlockHandler(BLOCK_HANDLER_ARGS)
 {
     InputInfoPtr    pInfo = (InputInfoPtr) data;
     EvdevPtr        pEvdev= (EvdevPtr) pInfo->private;
diff --git a/src/evdev.h b/src/evdev.h
index 0ebcfa0..c506296 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -71,6 +71,14 @@
 #define HAVE_THREADED_INPUT    1
 #endif
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 24
+#define BLOCK_HANDLER_ARGS             void *data, void *waitTime
+#define WAKEUP_HANDLER_ARGS    void *data, int i
+#else
+#define BLOCK_HANDLER_ARGS     pointer data, struct timeval **waitTime, 
pointer LastSelectMask
+#define WAKEUP_HANDLER_ARGS    void *data, int i, pointer LastSelectMask
+#endif
+
 #define EVDEV_MAXBUTTONS 32
 #define EVDEV_MAXQUEUE 32
 
@@ -264,8 +272,8 @@ unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr 
pEvdev, int code);
 /* Middle Button emulation */
 int  EvdevMBEmuTimer(InputInfoPtr);
 BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
-void EvdevMBEmuWakeupHandler(pointer, int, pointer);
-void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
+void EvdevMBEmuWakeupHandler(WAKEUP_HANDLER_ARGS);
+void EvdevMBEmuBlockHandler(BLOCK_HANDLER_ARGS);
 void EvdevMBEmuPreInit(InputInfoPtr);
 void EvdevMBEmuOn(InputInfoPtr);
 void EvdevMBEmuFinalize(InputInfoPtr);

commit 7b1267f7f18c478d3dc34a7668eaefa402815891
Author: Keith Packard <kei...@keithp.com>
Date:   Tue May 31 17:52:42 2016 -0700

    Support XINPUT ABI version 23 (threaded input)
    
    Use input_lock/input_unlock calls instead of SIGIO functions
    
    Signed-off-by: Keith Packard <kei...@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

diff --git a/src/emuMB.c b/src/emuMB.c
index b25eac8..94e50c4 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -184,10 +184,13 @@ int
 EvdevMBEmuTimer(InputInfoPtr pInfo)
 {
     EvdevPtr pEvdev = pInfo->private;
-    int        sigstate;
     int id;
 
-    sigstate = xf86BlockSIGIO ();
+#if HAVE_THREADED_INPUT
+    input_lock();
+#else
+    int sigstate = xf86BlockSIGIO();
+#endif
 
     pEvdev->emulateMB.pending = FALSE;
     if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
@@ -200,7 +203,11 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
                     pEvdev->emulateMB.state);
     }
 
-    xf86UnblockSIGIO (sigstate);
+#if HAVE_THREADED_INPUT
+    input_unlock();
+#else
+    xf86UnblockSIGIO(sigstate);
+#endif
     return 0;
 }
 
diff --git a/src/emuThird.c b/src/emuThird.c
index 5f14d33..dd49a84 100644
--- a/src/emuThird.c
+++ b/src/emuThird.c
@@ -89,12 +89,19 @@ Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg)
     InputInfoPtr      pInfo    = (InputInfoPtr)arg;
     EvdevPtr          pEvdev   = pInfo->private;
     struct emulate3B *emu3B    = &pEvdev->emulate3B;
-    int               sigstate = 0;
 
-    sigstate = xf86BlockSIGIO ();
+#if HAVE_THREADED_INPUT
+    input_lock();
+#else
+    int sigstate = xf86BlockSIGIO();
+#endif
     emu3B->state = EM3B_EMULATING;
     Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
-    xf86UnblockSIGIO (sigstate);
+#if HAVE_THREADED_INPUT
+    input_unlock();
+#else
+    xf86UnblockSIGIO(sigstate);
+#endif
     return 0;
 }
 
diff --git a/src/evdev.h b/src/evdev.h
index 4d44d2b..0ebcfa0 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -67,6 +67,10 @@
 #define LogMessageVerbSigSafe xf86MsgVerb
 #endif
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
+#define HAVE_THREADED_INPUT    1
+#endif
+
 #define EVDEV_MAXBUTTONS 32
 #define EVDEV_MAXQUEUE 32
 

commit e08b0332761b0cff6d6a3f5d7e88c22f786bd530
Author: Keith Packard <kei...@keithp.com>
Date:   Tue May 31 17:52:41 2016 -0700

    Report errors when attempting to write keyboard controls
    
    This is mostly to eliminate a compiler warning.
    
    Signed-off-by: Keith Packard <kei...@keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

diff --git a/src/evdev.c b/src/evdev.c
index 341db61..5ace238 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1108,6 +1108,7 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
     InputInfoPtr pInfo;
     struct input_event ev[ArrayLength(bits) + 1];
     int i;
+    int rc;
 
     memset(ev, 0, sizeof(ev));
 
@@ -1122,7 +1123,9 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
     ev[i].code = SYN_REPORT;
     ev[i].value = 0;
 
-    write(pInfo->fd, ev, sizeof ev);
+    rc = write(pInfo->fd, ev, sizeof ev);
+    if (rc != sizeof ev)
+           xf86IDrvMsg(pInfo, X_ERROR, "Failed to set keyboard controls: 
%s\n", strerror(errno));
 }
 
 static int

Reply via email to