[PATCH libinput] evdev: set CLOCK_MONOTONIC as the time source
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:
> 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.
More information about the wayland-devel