diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-05-24 18:46:42 +0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-05-31 08:44:38 +1000 |
commit | a779fda224bee0c4d27636503367e55ae93b33c2 (patch) | |
tree | 3ea15cc3f58b0599ee97bdea0797e5d3a4d82522 /include | |
parent | 28b2c880a9dbfd91e82397a0f22482d258a8b670 (diff) |
xwayland: Use the CLOCK_MONOTONIC clock
By default the X server will try CLOCK_MONOTONIC_COARSE before
CLOCK_MONOTONIC, while A Wayland compositor may only support getting
their timestamps from the CLOCK_MONOTONIC clock. This causes various
issues since it may happen that a timestamp from CLOCK_MONOTONIC
retrieved before a sending an X request will still be "later" than the
timestamp the X server than gets after receiving the request, due to the
fact that CLOCK_MONOTONIC_COARSE has a lower resolution.
To avoid these issues, make Xwayland always use CLOCK_MONOTONIC, so
that it becomes possible for Wayland compositor only supporting
CLOCK_MONOTONIC and X server to use the same clock.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/os.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h index 20224f127..702134b52 100644 --- a/include/os.h +++ b/include/os.h @@ -51,6 +51,9 @@ SOFTWARE. #include <stdarg.h> #include <stdint.h> #include <string.h> +#ifdef MONOTONIC_CLOCK +#include <time.h> +#endif #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -180,6 +183,10 @@ extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ ); extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); +#ifdef MONOTONIC_CLOCK +extern void ForceClockId(clockid_t /* forced_clockid */); +#endif + extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); |