Skip to content

Commit 169f912

Browse files
committed
xfree86: compat: re-add TimeCheck() for proprietary nvidia driver
Yet another very internal function that the proprietary Nvidia driver is using for unknown reasons. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
1 parent 122d5b9 commit 169f912

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

hw/xfree86/compat/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ srcs_xorg_compat = [
66
'xf86Helper.c',
77
]
88

9+
if get_option('legacy_nvidia_340x')
10+
srcs_xorg_compat += 'timercheck.c'
11+
endif
12+
913
xorg_compat = static_library('xorg_compat',
1014
srcs_xorg_compat,
1115
dependencies: common_dep,

hw/xfree86/compat/timercheck.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <dix-config.h>
2+
3+
#include <X11/Xfuncproto.h>
4+
5+
#include "os/osdep.h"
6+
7+
#include "xf86_compat.h"
8+
9+
/*
10+
* needed for NVidia proprietary driver 340.x versions
11+
* force the server to see if any timer callbacks should be called
12+
*
13+
* this function had been obsolete and removed long ago, but NVidia folks
14+
* still didn't do basic maintenance and fixed their driver
15+
*/
16+
17+
_X_EXPORT void TimerCheck(void);
18+
19+
void TimerCheck(void) {
20+
xf86NVidiaBugObsoleteFunc("TimerCheck()");
21+
22+
DoTimers(GetTimeInMillis());
23+
}

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ option('devel-docs', type: 'combo', choices: ['true', 'false', 'auto'], value: '
148148
option('docs-pdf', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
149149
description: 'Whether to build PDF version of documentation. Setting is ignored if documentation is not built.')
150150

151+
# legacy nvidia driver quirks
152+
option('legacy_nvidia_340x', type: 'boolean', value: true,
153+
description: 'Extra entrypoints for old Nvidia 340x proprietary driver')
154+
151155
# testsuite fine tuning - some things might not run everywhere
152156
option('test_rendercheck_triangles', type: 'boolean', value: false,
153157
description: 'testsuite: run rendercheck triangles tests (might fail on Xephyr)')

os/WaitFor.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ struct _OsTimerRec {
105105
};
106106

107107
static void DoTimer(OsTimerPtr timer, CARD32 now);
108-
static void DoTimers(CARD32 now);
109108
static void CheckAllTimers(void);
110109
static volatile struct xorg_list timers;
111110

@@ -276,8 +275,7 @@ DoTimer(OsTimerPtr timer, CARD32 now)
276275
TimerSet(timer, 0, newTime, timer->callback, timer->arg);
277276
}
278277

279-
static void
280-
DoTimers(CARD32 now)
278+
void DoTimers(CARD32 now)
281279
{
282280
OsTimerPtr timer;
283281

os/osdep.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,7 @@ Ones(unsigned long mask)
219219
}
220220
#endif
221221

222+
/* run timers that are expired at timestamp `now` */
223+
void DoTimers(CARD32 now);
224+
222225
#endif /* _OSDEP_H_ */

0 commit comments

Comments
 (0)