[PATCH xserver 8/9] xfree86: Use threaded input mechanism [v2]

Keith Packard keithp at keithp.com
Wed May 11 20:54:57 UTC 2016


Switch the XFree86 DDX over to threaded input

v2: Rewrite comment in xf86Helper about silken mouse

Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/xfree86/common/xf86Events.c |  4 ++--
 hw/xfree86/common/xf86Helper.c | 10 ++--------
 hw/xfree86/common/xf86Init.c   |  3 +++
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index df8c7b6..7191980 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -310,7 +310,7 @@ xf86ReadInput(int fd, int ready, void *closure)
 void
 xf86AddEnabledDevice(InputInfoPtr pInfo)
 {
-    SetNotifyFd(pInfo->fd, xf86ReadInput, X_NOTIFY_READ, pInfo);
+    InputThreadRegisterDev(pInfo->fd, xf86ReadInput, pInfo);
 }
 
 /*
@@ -320,7 +320,7 @@ xf86AddEnabledDevice(InputInfoPtr pInfo)
 void
 xf86RemoveEnabledDevice(InputInfoPtr pInfo)
 {
-    RemoveNotifyFd(pInfo->fd);
+    InputThreadUnregisterDev(pInfo->fd);
 }
 
 static int *xf86SignalIntercept = NULL;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 284858b..bceb017 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1719,15 +1719,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen)
     }
     free(options);
     /*
-     * XXX quick hack to report correctly for OSs that can't do SilkenMouse
-     * yet.  Should handle this differently so that alternate async methods
-     * work correctly with this too.
+     * Use silken mouse if requested and if we have threaded input
      */
-    /* Disable this completely when removing SIGIO support. It
-     * will get re-enabled correctly when we add threaded input
-     * support
-     */
-    pScrn->silkenMouse = useSM && FALSE;
+    pScrn->silkenMouse = useSM && InputThreadEnable;
     if (serverGeneration == 1)
         xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n",
                    pScrn->silkenMouse ? "enabled" : "disabled");
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index e6cd400..c5aeb16 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -887,6 +887,9 @@ InitInput(int argc, char **argv)
 
     xf86Info.vtRequestsPending = FALSE;
 
+    /* Enable threaded input */
+    InputThreadPreInit();
+
     mieqInit();
 
     /* Initialize all configured input devices */
-- 
2.8.0.rc3



More information about the xorg-devel mailing list