[PATCH 5/7] sync: if the idle time was reset, force alarms to trigger (#70476)

Keith Packard keithp at keithp.com
Thu Oct 17 15:55:29 PDT 2013

Peter Hutterer <peter.hutterer at who-t.net> writes:

> The time between the idle reset and the IdleTimeWakeupHandler to be called is
> indeterminate. Clients with an PositiveTransition or NegativeTransition alarm
> on a low threshold may miss an alarm.
> Work around this by keeping a reset flag for each device. When the
> WakeupHandler triggers and the reset flag is set, we force a re-calculation of
> everything and pretend the current idle time is zero. Immediately after is the
> next calculation with the real idle time.
> Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for
> a threshold of 1 ms. May trigger, may not.
> X.Org Bug 70476 <http://bugs.freedesktop.org/show_bug.cgi?id=70476>

This all looks quite reasonable, although I would have declared the
reset flag as Bool and used TRUE/FALSE everywhere instead of int 0/1.

Reviewed-by: Keith Packard <keithp at keithp.com>

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131017/3b9fe741/attachment.pgp>

More information about the xorg-devel mailing list