From a977c9c4d07a04c0c7b3713a21eefb92a8d3005b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 8 Dec 2015 14:53:08 -0800 Subject: [PATCH] xfree86: Use threaded input mechanism [v2] Switch the XFree86 DDX over to threaded input v2: Rewrite comment in xf86Helper about silken mouse Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer --- 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 df8c7b6e4..719198089 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 284858bfc..bceb0174b 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 cf726d4a0..323ac11fc 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 */