Sun Mar 5 08:05:23 2017 UTC ()
merge xf86-input-keyboard 1.9.0 and xf86-input-mouse 1.9.2


(mrg)
diff -r1.11 -r1.12 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
diff -r1.6 -r1.7 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c
diff -r1.2 -r1.3 xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in
diff -r1.17 -r1.18 xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c

cvs diff -r1.11 -r1.12 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c (expand / switch to context diff)
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c 2015/11/12 12:03:58 1.11
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c 2017/03/05 08:05:23 1.12
@@ -346,11 +346,11 @@
 	/* 133 */ KEY_NOTUSED,
 	/* 134 */ KEY_NOTUSED,
 /*
- * Special keycode for For Japanese keyboard
- * Override atKeyname HKTG and BSlash2 code to unique for JP106 keybaord
+ * Special keycodes for Japanese keyboards
+ * Override atKeyname HKTG and BSlash2 code to unique values for JP106 keyboards
  */
 #undef KEY_HKTG
-#define KEY_HKTG	200	/* Japanee Hiragana Katakana Toggle */
+#define KEY_HKTG	200	/* Japanese Hiragana Katakana Toggle */
 #undef KEY_BSlash2
 #define KEY_BSlash2	203	/* Japanese '\_' key */
 
@@ -364,9 +364,9 @@
 	/* 142 */ KEY_NOTUSED,
 	/* 143 */ KEY_NOTUSED,
 /*
- * Special keycode for For Korean keyboard
- * Define Hangul and Hangul_Hanja unique key code
- * These keys also use KANA and EISU on some Macintosh Japanese USB Keyboards
+ * Special keycodes for Korean keyboards
+ * Define Hangul and Hangul_Hanja unique key codes
+ * These keys also use KANA and EISU on some Macintosh Japanese USB keyboards
  */
 #define KEY_Hangul		201	/* Also KANA Key on Mac JP USB kbd */
 #define KEY_Hangul_Hanja	202	/* Also EISU Key on Mac JP USB kbd */

cvs diff -r1.6 -r1.7 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c (expand / switch to context diff)
--- xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c 2013/06/05 07:11:16 1.6
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c 2017/03/05 08:05:23 1.7
@@ -45,6 +45,10 @@
 #include "xkbstr.h"
 #include "xkbsrv.h"
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
+#define HAVE_THREADED_INPUT	1
+#endif
+
 #define CAPSFLAG	1
 #define NUMFLAG		2
 #define SCROLLFLAG	4
@@ -53,11 +57,7 @@
 /* Used to know when the first DEVICE_ON after a DEVICE_INIT is called */
 #define INITFLAG	(1U << 31)
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-static InputInfoPtr KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
-#else
 static int KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
-#endif
 static int KbdProc(DeviceIntPtr device, int what);
 static void KbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
 static void KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused);
@@ -66,24 +66,6 @@
 static void InitKBD(InputInfoPtr pInfo, Bool init);
 static void UpdateLeds(InputInfoPtr pInfo);
 
-_X_EXPORT InputDriverRec KBD = {
-	1,
-	"kbd",
-	NULL,
-	KbdPreInit,
-	NULL,
-	NULL
-};
-
-_X_EXPORT InputDriverRec KEYBOARD = {
-	1,
-	"keyboard",
-	NULL,
-	KbdPreInit,
-	NULL,
-	NULL
-};
-
 static const char *kbdDefaults[] = {
 #ifdef __NetBSD__
 #ifdef DEFAULT_TO_WSKBD
@@ -106,43 +88,52 @@
 static char *xkb_variant;
 static char *xkb_options;
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-static int
-NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
+_X_EXPORT InputDriverRec KBD = {
+    1,
+    "kbd",
+    NULL,
+    KbdPreInit,
+    NULL,
+    NULL
+};
 
-static InputInfoPtr
-KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
-{
-    InputInfoPtr pInfo;
+_X_EXPORT InputDriverRec KEYBOARD = {
+    1,
+    "keyboard",
+    NULL,
+    KbdPreInit,
+    NULL,
+    NULL
+};
 
-    if (!(pInfo = xf86AllocateInput(drv, 0)))
-	return NULL;
+static XF86ModuleVersionInfo xf86KbdVersionRec = {
+    "kbd",
+    MODULEVENDORSTRING,
+    MODINFOSTRING1,
+    MODINFOSTRING2,
+    XORG_VERSION_CURRENT,
+    PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
+    ABI_CLASS_XINPUT,
+    ABI_XINPUT_VERSION,
+    MOD_CLASS_XINPUT,
+    {0, 0, 0, 0}
+};
 
-    pInfo->name = dev->identifier;
-    pInfo->flags = XI86_KEYBOARD_CAPABLE;
-    pInfo->conversion_proc = NULL;
-    pInfo->reverse_conversion_proc = NULL;
-    pInfo->private_flags = 0;
-    pInfo->always_core_feedback = NULL;
-    pInfo->conf_idev = dev;
-    pInfo->close_proc = NULL;
-
-    if (NewKbdPreInit(drv, pInfo, flags) == Success)
-    {
-        pInfo->flags |= XI86_CONFIGURED;
-        return pInfo;
-    }
-
-    xf86DeleteInput(pInfo, 0);
-    return NULL;
+static pointer
+xf86KbdPlug(pointer module, pointer options, int *errmaj, int *errmin)
+{
+    xf86AddInputDriver(&KBD, module, 0);
+    return module;
 }
 
+_X_EXPORT XF86ModuleData kbdModuleData = {
+    &xf86KbdVersionRec,
+    xf86KbdPlug,
+    NULL
+};
+
 static int
-NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
-#else
-static int
 KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
-#endif
 {
     KbdDevPtr pKbd;
     char *s;
@@ -163,11 +154,7 @@
     pInfo->dev = NULL;
 
     defaults = kbdDefaults;
-    xf86CollectInputOptions(pInfo, defaults
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-            , NULL
-#endif
-            );
+    xf86CollectInputOptions(pInfo, defaults);
     xf86ProcessCommonOptions(pInfo, pInfo->options); 
 
     if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) {
@@ -309,6 +296,7 @@
 
   InputInfoPtr pInfo = device->public.devicePrivate;
   KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+  XkbRMLVOSet rmlvo;
   KeySymsRec           keySyms;
   CARD8                modMap[MAP_LENGTH];
   int                  ret;
@@ -322,23 +310,19 @@
          pKbd->KbdGetMapping(pInfo, &keySyms, modMap);
 
          device->public.on = FALSE;
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
+         rmlvo.rules = xkb_rules;
+         rmlvo.model = xkb_model;
+         rmlvo.layout = xkb_layout;
+         rmlvo.variant = xkb_variant;
+         rmlvo.options = xkb_options;
+
+         if (!InitKeyboardDeviceStruct(device, &rmlvo, KbdBell, KbdCtrl))
          {
-             XkbRMLVOSet rmlvo;
-             rmlvo.rules = xkb_rules;
-             rmlvo.model = xkb_model;
-             rmlvo.layout = xkb_layout;
-             rmlvo.variant = xkb_variant;
-             rmlvo.options = xkb_options;
+             xf86Msg(X_ERROR, "%s: Keyboard initialization failed. This "
+                     "could be a missing or incorrect setup of "
+                     "xkeyboard-config.\n", device->name);
 
-             if (!InitKeyboardDeviceStruct(device, &rmlvo, KbdBell, KbdCtrl))
-             {
-                 xf86Msg(X_ERROR, "%s: Keyboard initialization failed. This "
-                         "could be a missing or incorrect setup of "
-                         "xkeyboard-config.\n", device->name);
-
-                 return BadValue;
-             }
+             return BadValue;
          }
 # ifdef XI_PROP_DEVICE_NODE
          {
@@ -355,17 +339,6 @@
              }
          }
 # endif /* XI_PROP_DEVICE_NODE */
-#else
-         {
-             XkbComponentNamesRec xkbnames;
-             memset(&xkbnames, 0, sizeof(xkbnames));
-             XkbSetRulesDflts(xkb_rules, xkb_model, xkb_layout,
-                              xkb_variant, xkb_options);
-             XkbInitKeyboardDeviceStruct(device, &xkbnames, &keySyms,
-                                         modMap, KbdBell,
-                                         (KbdCtrlProcPtr)KbdCtrl);
-         }
-#endif /* XINPUT ABI 5*/
          InitKBD(pInfo, TRUE);
          break;
   case DEVICE_ON:
@@ -383,7 +356,11 @@
      */
     if (pInfo->fd >= 0) {
 	xf86FlushInput(pInfo->fd);
+#if HAVE_THREADED_INPUT
+	xf86AddEnabledDevice(pInfo);
+#else
 	AddEnabledDevice(pInfo->fd);
+#endif
     }
 
     device->public.on = TRUE;
@@ -396,8 +373,13 @@
     /*
      * Restore original keyboard directness and translation.
      */
-    if (pInfo->fd != -1)
+    if (pInfo->fd != -1) {
+#if HAVE_THREADED_INPUT
+      xf86RemoveEnabledDevice(pInfo);
+#else
       RemoveEnabledDevice(pInfo->fd);
+#endif
+    }
     pKbd->KbdOff(pInfo, what);
     device->public.on = FALSE;
     break;
@@ -451,40 +433,3 @@
 
   xf86PostKeyboardEvent(device, scanCode + MIN_KEYCODE, down);
 }
-
-static void
-xf86KbdUnplug(pointer	p)
-{
-}
-
-static pointer
-xf86KbdPlug(pointer	module,
-	    pointer	options,
-	    int		*errmaj,
-	    int		*errmin)
-{
-    xf86AddInputDriver(&KBD, module, 0);
-
-    return module;
-}
-
-static XF86ModuleVersionInfo xf86KbdVersionRec =
-{
-    "kbd",
-    MODULEVENDORSTRING,
-    MODINFOSTRING1,
-    MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
-    PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
-    ABI_CLASS_XINPUT,
-    ABI_XINPUT_VERSION,
-    MOD_CLASS_XINPUT,
-    {0, 0, 0, 0}		/* signature, to be patched into the file by */
-				/* a tool */
-};
-
-_X_EXPORT XF86ModuleData kbdModuleData = {
-    &xf86KbdVersionRec,
-    xf86KbdPlug,
-    xf86KbdUnplug
-};

cvs diff -r1.2 -r1.3 xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in (expand / switch to context diff)
--- xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in 2014/07/16 02:45:47 1.2
+++ xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in 2017/03/05 08:05:23 1.3
@@ -1,4 +1,6 @@
 prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
 includedir=@includedir@
 sdkdir=@sdkdir@
 

cvs diff -r1.17 -r1.18 xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c (expand / switch to context diff)
--- xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c 2015/07/22 09:42:15 1.17
+++ xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c 2017/03/05 08:05:23 1.18
@@ -129,6 +129,18 @@
 } DragLockRec, *DragLockPtr;
 
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
+#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
+
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
 static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags);
 #else
@@ -140,9 +152,8 @@
 static void MousePostEvent(InputInfoPtr pInfo, int buttons,
                            int dx, int dy, int dz, int dw);
 static void MouseReadInput(InputInfoPtr pInfo);
-static void MouseBlockHandler(pointer data, struct timeval **waitTime,
-                              pointer LastSelectMask);
-static void MouseWakeupHandler(pointer data, int i, pointer LastSelectMask);
+static void MouseBlockHandler(BLOCK_HANDLER_ARGS);
+static void MouseWakeupHandler(WAKEUP_HANDLER_ARGS);
 static void FlushButtons(MouseDevPtr pMse);
 
 static Bool SetupMouse(InputInfoPtr pInfo);
@@ -2025,12 +2036,18 @@
 buttonTimer(InputInfoPtr pInfo)
 {
     MouseDevPtr pMse;
+#if !HAVE_THREADED_INPUT
     int sigstate;
+#endif
     int id;
 
     pMse = pInfo->private;
 
+#if HAVE_THREADED_INPUT
+    input_lock();
+#else
     sigstate = xf86BlockSIGIO ();
+#endif
 
     pMse->emulate3Pending = FALSE;
     if ((id = stateTab[pMse->emulateState][4][0]) != 0) {
@@ -2041,7 +2058,11 @@
             "Got unexpected buttonTimer in state %d\n", pMse->emulateState);
     }
 
+#if HAVE_THREADED_INPUT
+    input_unlock();
+#else
     xf86UnblockSIGIO (sigstate);
+#endif
     return 0;
 }
 
@@ -2098,9 +2119,7 @@
 #endif
 }
 
-static void MouseBlockHandler(pointer data,
-                              struct timeval **waitTime,
-                              pointer LastSelectMask)
+static void MouseBlockHandler(BLOCK_HANDLER_ARGS)
 {
     InputInfoPtr    pInfo = (InputInfoPtr) data;
     MouseDevPtr     pMse = (MouseDevPtr) pInfo->private;
@@ -2115,9 +2134,7 @@
     }
 }
 
-static void MouseWakeupHandler(pointer data,
-                               int i,
-                               pointer LastSelectMask)
+static void MouseWakeupHandler(WAKEUP_HANDLER_ARGS)
 {
     InputInfoPtr    pInfo = (InputInfoPtr) data;
     MouseDevPtr     pMse = (MouseDevPtr) pInfo->private;
@@ -3276,14 +3293,20 @@
     unsigned char *para;
     mousePrivPtr mPriv = (mousePrivPtr)pMse->mousePriv;
     MouseProtocolID *tmplist = NULL;
+#if !HAVE_THREADED_INPUT
     int blocked;
+#endif
 
     AP_DBGC(("Autoprobe: "));
     for (i = 0; i < mPriv->count; i++)
         AP_DBGC(("%2.2x ", (unsigned char) mPriv->data[i]));
     AP_DBGC(("\n"));
 
+#if HAVE_THREADED_INPUT
+    input_lock();
+#else
     blocked = xf86BlockSIGIO ();
+#endif
 
     /* create a private copy first so we can write in the old list */
     if ((tmplist = malloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){
@@ -3392,7 +3415,11 @@
         }
     }
 
+#if HAVE_THREADED_INPUT
+    input_unlock();
+#else
     xf86UnblockSIGIO(blocked);
+#endif
 
     mPriv->protoList[k] = PROT_UNKNOWN;