Commit graph

3859 commits

Author SHA1 Message Date
Peter Hutterer
43b910b1df touchpad: reduce state debugging output by only logging changed states
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-15 13:08:47 +10:00
Peter Hutterer
f1873fae62 doc/user: fix a typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-10 14:44:23 +10:00
Peter Hutterer
7b9affcf4b meson: run the test suite per group
We can't run this in parallel so it doesn't gain us any speed advantage. If
anything, it'll be slower because it's more setup time in between. But: meson
doesn't display the result until the test suite finished, so having this
broken up into smaller chunks means we're more likely to see a general failure
early.

And the failure should be quicker to reproduce as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:46:20 +10:00
Peter Hutterer
47cf7e0995 test: use the default job control for --filter-groups
All filter arguments currently force a -j1 unless otherwise specified. Change
this for --filter-group since that one is most likely invoked by some test
setup that can either add -j X or set the environment variable LITEST_JOBS as
well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:28:47 +10:00
Peter Hutterer
63e7942008 meson.build: move the leftover udev rule check up
ninja executes the test in the same order but we don't want to waste 5 minutes
testing other things when we have a udev rule leftover from a previous run.

Plus, this test can't be run in parallel with others, so in the worst case we
had to wait for several long-running tests to finish before this one could be
started.

To avoid all this, let's move this up to be the first check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 13:25:32 +10:00
Peter Hutterer
734ada5e94 test: fix an always-true check for udev properties
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:53:49 +10:00
Peter Hutterer
cc908b68a9 test: fix two coverity warnings
Alleged division by zero and use of an uninitialized variable. Both cannot
happen the way we call the tests, so let's just abort to make coverity happy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:47:31 +10:00
Peter Hutterer
6f6a9d95d5 test: drop the litest feature enum, make it normal bits instead
The coverity compiler can't handle 64-bit enums and since it does provide
useful data, let's switch this to #defines instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-08 09:44:12 +10:00
pixl
cc370f53c4 Fixed a grammar error 2019-07-05 05:14:31 +00:00
Peter Hutterer
345846729c test: one O_NONBLOCK is enough
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-01 12:18:13 +10:00
Peter Hutterer
d1af333546 quirks: add touchpad range for cypress touchpads
As found in the Dell XPS 12 9Q23

Fixes #310

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-28 11:27:13 +10:00
Peter Hutterer
ffa487fac3 quirks: rename the cyapa quirks file to cypress
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:20:05 +10:00
Peter Hutterer
8d3788fa8c evdev: when the kernel fuzz is nonzero, set ours to zero
Our udev callout is supposed to reset the kernel fuzz to 0 and move the value
to the LIBINPUT_FUZZ property. This is to stop the kernel from applying its
own hysteresis-like approach.

Where the kernel fuzz is nonzero, something has gone wrong with that approach.
Complain about it and set our fuzz to zero, we are in the hands of the kernel
now. If we leave our fuzz as nonzero, we'll apply our own hysteresis on top of
the kernel's and that leads to unresponsive behavior.

Fixes #313

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:17:28 +10:00
Peter Hutterer
aa538dc5c8 meson: force litest to use the right udev rules
We generate litest-specific udev rules that contain the path to the binaries
in the builddir. But litest wasn't using those, so IMPORT would run things in
/usr/lib/udev instead. Thus any changes to those binaries generated false test
results depending on how compatible the system-installed libinput was.

This is why 410b157 passed the test suite for example.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-27 11:17:28 +10:00
Peter Hutterer
6a489b0636 tools: return 77 if gtk_init() fails in the debug-gui
And when that happens, skip the tests because what's happening here is that
you're running tests as root, but your X server doesn't allow root to connect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:09:22 +10:00
Peter Hutterer
523c82abb5 meson: increase the test time for the selftest suite
Because it's timing out on the XPS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:07:24 +10:00
Peter Hutterer
61553432b0 test: disable coredumps for the selftest
Because on my XPS coredumps take away all the CPU, leading to a test timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:07:21 +10:00
Peter Hutterer
82958a31f1 evdev: only extract the fuzz for touchpads and touchscreens
We don't have a hysteresis for tablet devices, so let's leave those as-is.

This may be a slight regression in behavior compared to pre-410b157e84 now the
kernel will apply the fuzz. Let's see if anyone notices, the fuzz is usually
so tiny on tablets that it shouldn't be noticable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 18:27:36 +10:00
Peter Hutterer
82102f8599 If we never initialized the libwacom database, don't check the refcount
If the libwacom context failed to initialize for some reason, the database is
NULL and the refcount remains at zero. Calling unref should just work then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 14:15:09 +10:00
Peter Hutterer
b12084ef76 tools: skip debug-gui option testing if the debug-gui is disabled
Fixes #311

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 03:23:55 +00:00
Peter Hutterer
1f59f06266 udev: only change the fuzz on touchpads and touchscreens (v2)
If we don't handle a device, don't touch it. Especially joysticks that we
don't handle and thus should not touch either.

Related to !231

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 12:21:33 +10:00
Peter Hutterer
e65392c2f5 udev: rename libinput-model-quirks rules to libinput-fuzz-override.rules
Because these days, that's all it does

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 12:21:17 +10:00
Peter Hutterer
d6c075030d Revert "udev: only change the fuzz on touchpads and touchscreens"
This causes a regression - the ID_INPUT_* properties are not available through
libudev within a callout, the device we get here basically has no properties.

Reverts !231

This reverts commit 410b157e84.
2019-06-26 11:21:58 +10:00
Peter Hutterer
34afe3ba1c tools: improve the error messages for measure touch-size/touchpad-pressure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:50:08 +10:00
Peter Hutterer
3f557f7246 doc: note that libinput measure is a separate package
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:50:08 +10:00
Peter Hutterer
015af5f3dc test: fix the slot swap test again
The previous movement was one finger still, the second finger moving. This may
cause axis events to trigger when a 2fg scroll gesture was detected. Those
axis events will stop after the gesture timeout but generate one more axis
stop event.

Make two changes here: first, move the fingers like a proper 2fg scroll
motion. And shuffle around the litest_drain_events() calls to ignore any axis
event immediately after the timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:30:05 +10:00
Peter Hutterer
1796fd92e7 test: avoid a pointer jump when testing for the slot continuation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
8b4c040bfb test: fix the slot swap test
This test worked because no gesture was detected in the initial movement.
If that happens though, releasing one finger triggers the gesture timeout
during which we suppress events, thus failing the test. Fix this by moving,
waiting, moving - that will definitely generate an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
8f8ad0e31b test: use an enum for the cardinals
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
996270d1a1 test: fix button area scroll test to not be a pinch
Second finger's x coordinate was wrong. That we didn't pick this up as pinch
is quite telling too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
160d3f2b66 test: move the fingers closer together for the empty-slot test
If we're testing for this, let's not try to get it picked up as pinch
gestures. Only an issue on the wacom and magic trackpads because of their
physical size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
5bcfbfe9dc test: change touchpad 2fg no-motion test to move both fingers simultaneously
In the future we may allow motion with one finger on the touchpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
timrichardson
62936d8a41 X230 trackpoint quirk 2019-06-20 13:55:49 +10:00
Peter Hutterer
d82f3b8798 test: replace a touch move with a timeout
We only care about the third-finger data here, the movement of the first two
was just to get out of the base tap states. A timeout will do the same thing
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-19 11:08:40 +10:00
Peter Hutterer
b40149f5cb test: fix initial coordinates for synaptics tripletap quirk
I don't think there was a specific reason for the second touch point to jump
around here either and the comment indicates it was just to avoid the
clickfinger distance trigger. So let's just move the first touchpoint.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-19 11:08:40 +10:00
Peter Hutterer
865100310c test: don't form a pinch gesture for the clickfinger distance test
If the fingers are in the position in the current code, that's not a 3fg
click, that's a pinch. Let's use something more realistic.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-19 11:08:40 +10:00
Peter Hutterer
3c84d5c750 test: don't go into the thumb area for the 3fg clickfinger distance check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-19 11:08:40 +10:00
Peter Hutterer
def787fe81 test: remove two spurious SYN_REPORTs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-19 11:08:40 +10:00
Peter Hutterer
c3c3c4b2ae test: add another test for thumb movements
Small movements mustn't trigger events, large movements should.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-18 18:29:19 +10:00
Peter Hutterer
84872fa35b test: fix the clickfinger thumb test
This test was putting both fingers down in the thumb area. That's not
representative, it's more likely that a thumb is in the area and the second
finger clicks elsewhere. So let's test for that instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-18 18:29:19 +10:00
Peter Hutterer
1d9e32c91f test: rename/fix/move thumb tests
These were supposed to test the thumb area, but the pressure exceeded the
threshold for most devices, thus ending up testing the palm detection instead.

Fix to use a timeout where possible, otherwise move them to the palm detection
code instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-18 14:18:47 +10:00
Peter Hutterer
305251e633 touchpad: slightly change a debug message
Makes it clearer that thumb detection always enables area-based detection.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-18 14:18:47 +10:00
Peter Hutterer
9cb089f2b6 tablet: disable the forced proximity out for the Dell Canvas pen
This pen has random timeouts, often when a button is pressed. This causes a
forced proximity out (and the button release) and makes the whole device a
tad unusable.

Nothing we can detect by heuristics since it looks like other devices that
don't send proximity out events. And the timeout can be quite high, the
recording in #304 has over 800ms for one sequence.

Fixes #304

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-17 14:39:58 +10:00
Peter Hutterer
d13e11c24f quirk: drop the ModelTabletNoTilt quirk
This quirk is unused, use AttrEventCodeDisable instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-17 14:39:58 +10:00
Peter Hutterer
ffd8c71e4e tablet: fix double proximity out on slow proximity out pens
Where the proximity out event is delayed by the kernel, libinput would cause
an extra proxmity in-out after the forced proximity out event.

Event sequence is basically (k: kernel, l: libinput)

k: tablet axis events
l: tablet axis events
k: nothing for $proximity timer milliseconds
l: tablet proximity out
k: proximity out event
l: proximity in event
l: proximity out event

Fixes #306

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-17 14:39:58 +10:00
Peter Hutterer
ea5b764eb4 test: don't make timer offset errors fatal in gdb
No way we can debug without triggering those, so let's not make them fatal.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-17 14:39:57 +10:00
Michael Forney
9c89ab6d95 Replace one more __builtin_popcount with bitwise test
__builtin_popcount might not be available and in this case, a bitwise-and
can accomplish the same task.

Signed-off-by: Michael Forney <mforney@mforney.org>
2019-06-16 19:41:58 -07:00
Michael Forney
552d5aeba5 Don't return expression in function returning void
This is a constraint violation in ISO C[0].

[0] http://port70.net/~nsz/c/c11/n1570.html#6.8.6.4p1

Signed-off-by: Michael Forney <mforney@mforney.org>
2019-06-15 15:24:10 -07:00
Michael Forney
39c0d633f7 Use bitwise test instead of __builtin_popcount
__builtin_popcount might not be available on all compilers, so using
it requires a configure check and fallback implementation. In fact
on gcc without an -march flag, it gets compiled to a function call to
libgcc. However, we only need to test whether multiple bits are set,
and this can be done easily with a bitwise and.

Signed-off-by: Michael Forney <mforney@mforney.org>
2019-06-15 15:24:10 -07:00
Michael Forney
7160db054a Avoid case ranges in switch statement
Signed-off-by: Michael Forney <mforney@mforney.org>
2019-06-15 15:24:10 -07:00