mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 07:18:08 +02:00
timer: change the timer offset warning to a client bug
This looks like a libinput bug (well, it does say "libinput bug" on the package) but it hasn't been that for a long time. The cause is almost always insufficient motivation to call libinput_dispatch() by the caller, or at least not doing it with the celerity libinput demands (and deserves, if I may say so). Up-, down- or side-grade it to a client bug, so the outrage can be directed elsewhere, preferably away from me. And add a section to the documentation, just in case someone actually reads this stuff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
parent
d4b76be18b
commit
64c73d7ae6
2 changed files with 26 additions and 4 deletions
22
doc/faqs.dox
22
doc/faqs.dox
|
|
@ -198,4 +198,26 @@ href="https://www.freedesktop.org/software/systemd/man/hwdb.html">udev
|
||||||
hwdb</a> or patches that include a change to the hwdb. See @ref hwdb for
|
hwdb</a> or patches that include a change to the hwdb. See @ref hwdb for
|
||||||
details on the hwdb and how to modify it locally.
|
details on the hwdb and how to modify it locally.
|
||||||
|
|
||||||
|
@section faq_timer_offset What causes the "timer offset negative" warning?
|
||||||
|
|
||||||
|
libinput relies on the caller to call libinput_dispatch() whenever data is
|
||||||
|
available on the epoll-fd. Doing so will process the state of all devices
|
||||||
|
and can trigger some timers to be set (e.g. palm detection, tap-to-click,
|
||||||
|
disable-while-typing, etc.). Internally, libinput's time offsets are always
|
||||||
|
based on the event time of the triggering event.
|
||||||
|
|
||||||
|
For example, a touch event with time T may trigger a timer for the time T +
|
||||||
|
180ms. When setting a timer, libinput checks the wall clock time to ensure
|
||||||
|
that this time T + offset is still in the future. If not, the warning is
|
||||||
|
logged.
|
||||||
|
|
||||||
|
When this warning appears, it simply means that too much time has passed
|
||||||
|
between the event occurring (and the epoll-fd triggering) and the current
|
||||||
|
time. In almost all cases this is an indication of the caller being
|
||||||
|
overloaded and not handling events as speedily as required.
|
||||||
|
|
||||||
|
The warning has no immediate effect on libinput's behavior but some of the
|
||||||
|
functionality that relies on the timer may be impeded (e.g. palms are not
|
||||||
|
detected as they should be).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,10 @@ libinput_timer_set_flags(struct libinput_timer *timer,
|
||||||
uint64_t now = libinput_now(timer->libinput);
|
uint64_t now = libinput_now(timer->libinput);
|
||||||
if (expire < now) {
|
if (expire < now) {
|
||||||
if ((flags & TIMER_FLAG_ALLOW_NEGATIVE) == 0)
|
if ((flags & TIMER_FLAG_ALLOW_NEGATIVE) == 0)
|
||||||
log_bug_libinput(timer->libinput,
|
log_bug_client(timer->libinput,
|
||||||
"timer %s: offset negative (-%dms)\n",
|
"timer %s: offset negative (-%dms)\n",
|
||||||
timer->timer_name,
|
timer->timer_name,
|
||||||
us2ms(now - expire));
|
us2ms(now - expire));
|
||||||
} else if ((expire - now) > ms2us(5000)) {
|
} else if ((expire - now) > ms2us(5000)) {
|
||||||
log_bug_libinput(timer->libinput,
|
log_bug_libinput(timer->libinput,
|
||||||
"timer %s: offset more than 5s, now %d expire %d\n",
|
"timer %s: offset more than 5s, now %d expire %d\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue