From 4ad21c3247d98ac6c5ad71fa36be60ed04f7c92c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 21 Feb 2019 15:22:57 -0800 Subject: [PATCH] Add ddxInputThread call from os layer into ddx layer Allows ddx's to run additional code as necessary to set up the input thread. Signed-off-by: Alan Coopersmith --- hw/dmx/dmxinit.c | 9 +++++++++ hw/kdrive/ephyr/ephyrinit.c | 9 +++++++++ hw/vfb/InitOutput.c | 9 +++++++++ hw/xfree86/common/xf86Init.c | 9 +++++++++ hw/xnest/Init.c | 9 +++++++++ hw/xwayland/xwayland.c | 9 +++++++++ hw/xwin/InitOutput.c | 9 +++++++++ include/os.h | 2 ++ os/inputthread.c | 2 ++ 9 files changed, 67 insertions(+) diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 4fef30273..f80e58666 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -830,6 +830,15 @@ ddxBeforeReset(void) } #endif +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + /** This function is called in Xserver/os/osinit.c from \a OsInit(). */ void OsVendorInit(void) diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index abc35dfca..47bd97ade 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -100,6 +100,15 @@ CloseInput(void) KdCloseInput(); } +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + #ifdef DDXBEFORERESET void ddxBeforeReset(void) diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index be26467ea..240903b8e 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -226,6 +226,15 @@ ddxBeforeReset(void) } #endif +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + void ddxUseMsg(void) { diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index b148e1320..9e666643e 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1340,3 +1340,12 @@ ddxBeforeReset(void) { } #endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index 8edf03372..cd4ee61f9 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -159,3 +159,12 @@ ddxBeforeReset(void) return; } #endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 289683b6e..739f86cf1 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -66,6 +66,15 @@ ddxBeforeReset(void) { return; } +#endif + +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} #endif _X_NORETURN diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 98385a8c4..796b567d1 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -151,6 +151,15 @@ ddxBeforeReset(void) } #endif +#if INPUTTHREAD +/** This function is called in Xserver/os/inputthread.c when starting + the input thread. */ +void +ddxInputThreadInit(void) +{ +} +#endif + int main(int argc, char *argv[], char *envp[]) { diff --git a/include/os.h b/include/os.h index 553126734..a1835cd6a 100644 --- a/include/os.h +++ b/include/os.h @@ -559,6 +559,8 @@ enum ExitCode { extern _X_EXPORT void ddxGiveUp(enum ExitCode error); +extern _X_EXPORT void +ddxInputThreadInit(void); extern _X_EXPORT int TimeSinceLastInputEvent(void); diff --git a/os/inputthread.c b/os/inputthread.c index 97e59d21f..e6694afda 100644 --- a/os/inputthread.c +++ b/os/inputthread.c @@ -318,6 +318,8 @@ InputThreadDoWork(void *arg) sigfillset(&set); pthread_sigmask(SIG_BLOCK, &set, NULL); + ddxInputThreadInit(); + inputThreadInfo->running = TRUE; #if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID)