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

2014-02-19 Thread Peter Hutterer
On Tue, Feb 18, 2014 at 07:44:54PM -0800, Thiago Macieira wrote: > Em ter 18 fev 2014, às 22:33:26, Jasper St. Pierre escreveu: > > ... and what if it fails? I'd say that requiring CLOCK_MONOTONIC is fine. > > > > Are there any popular Linux setups that don't have CLOCK_MONOTONIC? > > I'm guessin

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

2014-02-19 Thread Peter Hutterer
On Wed, Feb 19, 2014 at 07:19:15PM +0100, Rui Tiago Cação Matos wrote: > On 19 February 2014 13:35, Daniel Stone 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

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

2014-02-19 Thread Rui Tiago Cação Matos
On 19 February 2014 13:35, Daniel Stone 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/x

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

2014-02-19 Thread Daniel Stone
Hi, On 18 February 2014 22:47, Peter Hutterer 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 inste

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

2014-02-18 Thread Thiago Macieira
Em ter 18 fev 2014, às 22:33:26, Jasper St. Pierre escreveu: > ... and what if it fails? I'd say that requiring CLOCK_MONOTONIC is fine. > > Are there any popular Linux setups that don't have CLOCK_MONOTONIC? I'm guessing that some weird and niche embedded boards might not support it. Which is a

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

2014-02-18 Thread Jasper St. Pierre
... and what if it fails? I'd say that requiring CLOCK_MONOTONIC is fine. Are there any popular Linux setups that don't have CLOCK_MONOTONIC? On Tue, Feb 18, 2014 at 10:13 PM, Thiago Macieira wrote: > Em qua 19 fev 2014, às 08:47:32, Peter Hutterer escreveu: > > + libevdev_set_clock_id(d

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

2014-02-18 Thread Thiago Macieira
Em qua 19 fev 2014, às 08:47:32, Peter Hutterer escreveu: > + libevdev_set_clock_id(device->evdev, CLOCK_MONOTONIC); What happens if the monotonic clock isn't supported? Shouldn't you check that sysconf(_SC_MONOTONIC_CLOCK) > 0 ? -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT)

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

2014-02-18 Thread Peter Hutterer
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. Signed-off-by: Peter Hutterer --- src/evdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git