[PATCH xserver 4/6] xfree86: Use threaded input mechanism

Keith Packard keithp at keithp.com
Tue Dec 8 15:44:52 PST 2015


Switch the XFree86 DDX over to threaded input

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/common/xf86Events.c | 5 +++--
 hw/xfree86/common/xf86Helper.c | 2 +-
 hw/xfree86/common/xf86Init.c   | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 3d16f24..e02a5de 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -71,6 +71,7 @@
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 #include "inputstr.h"
+#include "inputthread.h"
 #include "xf86Xinput.h"
 
 #include "mi.h"
@@ -309,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);
 }
 
 /*
@@ -319,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 b506338..0aeefd6 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1729,7 +1729,7 @@ xf86SetSilkenMouse(ScreenPtr pScreen)
      * yet.  Should handle this differently so that alternate async methods
      * work correctly with this too.
      */
-    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 5281e3e..156f503 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -954,6 +954,9 @@ InitInput(int argc, char **argv)
 
     xf86Info.vtRequestsPending = FALSE;
 
+    /* Enable threaded input */
+    InputThreadPreInit();
+
     mieqInit();
 
     /* Initialize all configured input devices */
-- 
2.6.2



More information about the xorg-devel mailing list