From c4470c3dcafd94abcc211488f95bf7cbc961f168 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Tue, 24 Jun 2025 10:28:02 -0700 Subject: [PATCH] Revert "os: drop unused TimerCheck()" The NVIDIA driver uses this function. This reverts commit 1dc648b1b77033179db8bcaba304be5cc7631a43. Signed-off-by: Aaron Plattner --- doc/Xserver-spec.xml | 6 +++++- include/os.h | 1 + os/WaitFor.c | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml index c2508def1..a4450dbdb 100644 --- a/doc/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -859,7 +859,7 @@ Similarly, the X server or an extension may need to wait for some timeout. Early X releases implemented this functionality using block and wakeup handlers, but this has been rewritten to use a general timer facilty, and the internal screen saver facilities reimplemented to use Timers. -These functions are TimerInit, TimerForce, TimerSet, TimerCancel, +These functions are TimerInit, TimerForce, TimerSet, TimerCheck, TimerCancel, and TimerFree, as defined in Xserver/include/os.h. A callback function will be called when the timer fires, along with the current time, and a user provided argument.
@@ -892,6 +892,8 @@ for the timer entry. Bool TimerForce(OsTimerPtr /* pTimer */) + void TimerCheck(void); + void TimerCancel(OsTimerPtr /* pTimer */) void TimerFree(OsTimerPtr /* pTimer */) @@ -902,6 +904,7 @@ TimerInit frees any existing timer entries. TimerForce forces a call to the time callback function and returns true if the timer entry existed, else it returns false and does not call the callback function. TimerCancel will cancel the specified timer. TimerFree calls TimerCancel and frees the specified timer. +Calling TimerCheck will force the server to see if any timer callbacks should be called. @@ -5037,6 +5040,7 @@ mi and fb implementations. StoreColorsddxScreen SubtractmiScreen TimerCancelos +TimerCheckos TimerForceos TimerFreeos TimerInitos diff --git a/include/os.h b/include/os.h index 929769fb3..c28849de1 100644 --- a/include/os.h +++ b/include/os.h @@ -127,6 +127,7 @@ extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr timer, OsTimerCallback func, void *arg); +extern _X_EXPORT void TimerCheck(void); extern _X_EXPORT void TimerCancel(OsTimerPtr /* pTimer */ ); extern _X_EXPORT void TimerFree(OsTimerPtr /* pTimer */ ); diff --git a/os/WaitFor.c b/os/WaitFor.c index 973a3495d..a616850ab 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -48,7 +48,7 @@ SOFTWARE. * OS Dependent input routines: * * WaitForSomething - * TimerForce, TimerSet, TimerFree + * TimerForce, TimerSet, TimerCheck, TimerFree * *****************************************************************/ @@ -373,6 +373,12 @@ TimerFree(OsTimerPtr timer) free(timer); } +void +TimerCheck(void) +{ + DoTimers(GetTimeInMillis()); +} + void TimerInit(void) {