[PATCH libinput] evdev: set CLOCK_MONOTONIC as the time source

Daniel Stone daniel at fooishbar.org
Wed Feb 19 04:35:37 PST 2014


Hi,

On 18 February 2014 22:47, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> Avoids erroneous timestamps when the system time is reset. This used to a be a
> problem with the X.Org synaptics driver where taps, scrolling and a couple of
> other things would potentially lock up.

Can this be CLOCK_MONOTONIC_COARSE instead, to avoid griefing HPET and
thus causing much higher power usage?

Cheers,
Daniel

> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  src/evdev.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/evdev.c b/src/evdev.c
> index 2c88c04..ab5a0c9 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -31,6 +31,7 @@
>  #include <fcntl.h>
>  #include <mtdev-plumbing.h>
>  #include <assert.h>
> +#include <time.h>
>
>  #include "libinput.h"
>  #include "evdev.h"
> @@ -639,6 +640,8 @@ evdev_device_create(struct libinput_seat *seat,
>         if (rc != 0)
>                 return NULL;
>
> +       libevdev_set_clock_id(device->evdev, CLOCK_MONOTONIC);
> +
>         device->seat_caps = 0;
>         device->is_mt = 0;
>         device->mtdev = NULL;
> --
> 1.8.4.2
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list