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

Peter Hutterer peter.hutterer at who-t.net
Wed Feb 19 16:52:06 PST 2014


On Wed, Feb 19, 2014 at 07:19:15PM +0100, Rui Tiago Cação Matos wrote:
> On 19 February 2014 13:35, Daniel Stone <daniel at fooishbar.org> wrote:
> > Can this be CLOCK_MONOTONIC_COARSE instead, to avoid griefing HPET and
> > thus causing much higher power usage?
> 
> Makes sense and indeed the X server seems to use _COARSE if it's
> available and has good enough resolution:
> 
> http://cgit.freedesktop.org/xorg/xserver/tree/os/utils.c#n440
> 
> Perhaps libevdev should do something like that too?

Note that this doesn't affect clock_gettime like the server's code does, it
only affects the timestamps of the events as reported by the kernel. It's a
wrapper around the EVIOCSCLOCKID ioctl and that only allows for
CLOCK_MONOTONIC and CLOCK_REALTIME (as of 3.14-rc3). So using _COARSE here
would merely yield -EINVAL.

Cheers,
   Peter



More information about the wayland-devel mailing list