diff options
author | Sean Farley <scf@FreeBSD.org> | 2021-07-01 18:22:00 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2021-07-01 18:30:11 +0000 |
commit | 227228845cd678bfb6cc8e9183e259f88e55567b (patch) | |
tree | baab50a05170fb9bf3ede19d650df3024e51fa11 | |
parent | 18398269fb6dc7cfb62b471e11caca1b8b586877 (diff) | |
download | ports-227228845cd678bfb6cc8e9183e259f88e55567b.tar.gz ports-227228845cd678bfb6cc8e9183e259f88e55567b.zip |
x11-servers/xorg-server: patch to utilize CLOCK_MONOTONIC_FAST for the clock
This patches the X server to use CLOCK_MONOTONIC_FAST instead of
CLOCK_MONOTONIC for the clock. This is basically a reintroduction of
r208485 by jkim@ that was removed by accident(?).
Since the X server is fine with the Linux _COARSE clock the accuracy of
the FreeBSD _FAST clock should work too. I have run with this patch for
a long time without ill effects.
PR: 252816
Reviewed by: imp, markj, jkim, mhorne
Approved by: x11
-rw-r--r-- | x11-servers/xorg-server/Makefile | 2 | ||||
-rw-r--r-- | x11-servers/xorg-server/files/patch-os-utils.c | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile index 8f3e831fc67a..39ec9df6267a 100644 --- a/x11-servers/xorg-server/Makefile +++ b/x11-servers/xorg-server/Makefile @@ -2,7 +2,7 @@ PORTNAME?= xorg-server PORTVERSION?= 1.20.11 -PORTREVISION?= 2 +PORTREVISION?= 3 PORTEPOCH?= 1 CATEGORIES= x11-servers MASTER_SITES= XORG/individual/xserver diff --git a/x11-servers/xorg-server/files/patch-os-utils.c b/x11-servers/xorg-server/files/patch-os-utils.c new file mode 100644 index 000000000000..8f9c4f1f137d --- /dev/null +++ b/x11-servers/xorg-server/files/patch-os-utils.c @@ -0,0 +1,18 @@ +--- os/utils.c.orig 2014-04-15 01:01:57 UTC ++++ os/utils.c +@@ -443,11 +443,11 @@ GetTimeInMillis(void) + static clockid_t clockid; + + if (!clockid) { +-#ifdef CLOCK_MONOTONIC_COARSE +- if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 && ++#ifdef CLOCK_MONOTONIC_FAST ++ if (clock_getres(CLOCK_MONOTONIC_FAST, &tp) == 0 && + (tp.tv_nsec / 1000) <= 1000 && +- clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0) +- clockid = CLOCK_MONOTONIC_COARSE; ++ clock_gettime(CLOCK_MONOTONIC_FAST, &tp) == 0) ++ clockid = CLOCK_MONOTONIC_FAST; + else + #endif + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) |