Commit graph

2371 commits

Author SHA1 Message Date
Peter Hutterer
9e8f6bd1d6 test: add touchpad pressure tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
568d527caa touchpad: use pressure values for touch is-down decision
Don't rely on BTN_TOUCH for "finger down", the value for that is hardcoded in
the kernel and not always suitable. Some devices need a different value to
avoid reacting to accidental touches or hovering fingers.

Implement a basic Schmitt trigger, same as we have in the synaptics driver. We
also take the default values from there but these will likely see some
updates.

A special case is when we have more fingers down than slots. Since we can't
detect the pressure on fake fingers (we only get a bit for 'is down') we
assume that *all* fingers are down with sufficient pressure. It's too much of
a niche case to have this work any other way.

This patch drops the handling of ABS_DISTANCE because it's simply not needed
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
2b3fe1a73e test: add the right pressure bits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
c27f9afffc test: make sure touch up resets pressure
Should be overridden by the test devices where something more fine-grained is
needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 10:50:28 +10:00
Peter Hutterer
8dfdf6b76f test: switch the semi-mt devices to use the litest semi-mt handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:44:04 +10:00
Peter Hutterer
cef3a8705e test: handle semi-mt devices in litest
Don't rely on the devices to handle themselves, just handle it globally

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:45 +10:00
Peter Hutterer
72ac3c1aee test: convert event handling while loops into for loops
No functional changes, just enables us to use 'continue' instead of piling up
negated conditions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
11b37080df test: allow nesting of litest_push_event_frame()
Right now, we fail if we call litest_push_event_frame() when already inside a
frame. For the semi-mt handling we need to do exactly that though, so turn it
into a counting semaphore instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
3170b3519b touchpad: ignore hovering touches when tapping
We need to remember whether a tap was down or just hovering, otherwise we mess
up the state machine when we send tap release events for taps that never
switched to TOUCH_BEGIN. This is quick fix, really we should have a new state
here, but that's a lot harder to implement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:02 +10:00
Peter Hutterer
618ee6ac94 test: force a pressure of 0 when we hover a touch
As we switch to pressure-based touch detection, we need for all
pressure-capable touchpads to send pressure values. They'll do so by filling
in an axis default but that breaks our current hover code.

Make sure the hover litest helpers force a pressure of 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:01 +10:00
Peter Hutterer
7c8cecdb02 test: add two more touch..._extended functions
So we can set pressure during touch sequences

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 15:43:01 +10:00
Peter Hutterer
6ef816b4f5 autogen.sh: exec the configure script
No point in waiting for it here, might as well pass the baton.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:43:35 +10:00
Mihail Konev
2ec596c265 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:43:10 +10:00
Peter Hutterer
b2109ca535 touchpad: use a helper function for the libinput context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-25 17:08:51 +10:00
Peter Hutterer
13a2336beb evdev: fix an error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-25 13:24:48 +10:00
Peter Hutterer
a64f9df5ce Drop normalized_get_direction, use physical distances instead
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-23 10:43:04 +10:00
Peter Hutterer
33d708e2de touchpad: convert normalized_length to physical coordinates
Now that the acceleration code doesn't use dpi-normalized coordinates anymore,
we don't need to use them in the touchpad code. Switch to physical distances
instead, it makes debugging a lot saner.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-23 10:37:08 +10:00
Peter Hutterer
43352590f7 touchpad: mask out ABS_MT if we don't have or disable MT
Make sure the events we deal with are the ones we actually honor. This reduces
the chance that we accidentally process events we weren't event supposed to
get based on some earlier device decision.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-23 10:00:48 +10:00
Peter Hutterer
ebeba8e8ff Merge branch 'wip/wheel-tilt-source' 2017-01-20 12:51:53 +10:00
Peter Hutterer
dbb376f74b test: add wheel tilt tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-20 11:45:29 +10:00
Peter Hutterer
631fab6ebd Merge branch 'gcov' 2017-01-20 10:35:55 +10:00
Peter Hutterer
aba825658b test: add test to set tap map on unsupported devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
35421834c7 test: check the pad button state in litest_is_pad_button_event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
7fe7f50a37 test: add tests for tablet buttons and button seat count
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
20b354449f test: add more tests for tap-drag config
Including one to get/set it on unsupported devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
44fe6f6312 test: ad calls to check whether pressure has changed
Nothing actually called that function, sprinkle a few calls into existing
tests to make sure it actually works.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
96f0140749 test: test absence of scroll events on keyboards
Executes the paths to set invalid scroll methods.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
989113cdb9 test: add device size/no size checks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:45 +10:00
Peter Hutterer
db0f84b3ce test: add a test for the tool ID
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
a7f4939f91 test: add a test for tablet pad event timestamps
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
dbeaa06712 test: add test for tablet_tool_get/set_user_data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
d9f09cec76 test: add a tablet tool capability check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
4e7db651ce test: add a test to force a destroy for the path backend
The test suite (and tests) we have now all clean up nicely before calling the
final libinput_unref(). Add one where there's at least one device still
connected.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
b887ddc756 test: add some device capability checks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
0d09791afb test: add test for fetching invalid pointer axes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
a1a10242bd test: test for libinput_device_get/set_user_data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
66d12ac8ff test: add tests for checking for buttons for a non-pointer device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:44 +10:00
Peter Hutterer
9ab8e7f783 util: make all property parsing helpers ignore NULL strings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
7c6784dd81 test: add test for invalid path operations on udev backends
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
0a34ed409e test: add test for invalid udev_assign_seat on path context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
fcddfc6b11 test: add helper function to install a "bug expected" log handler
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
50dfd52cd7 test: add a test for keyboard LED updates
Not much we can check for here anyway, but at least we can trigger the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:43 +10:00
Peter Hutterer
a87e2558cf Hook up gcov for coverage reports
./configure --enable-gcov adds the required flags to link everything ready for
gcov. A new make gcov target runs the test suite, then pulls all the gcov bits
together into ./test/gcov-reports/ including a summary file.

The script to pull everything out is used in libevdev too, we just have an
extra condition here to ignore the selftest gcov bits (it overwrites the
useful litest.c coverage output).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 10:35:37 +10:00
Peter Hutterer
7f78251018 configure.ac: libinput 1.6.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20 08:29:28 +10:00
Peter Hutterer
5f0d310ead filter: normalize deltas before processing or returning them
When the filter code switched to raw device coordinates (bdd4264d) the input
data remained in device coordinates. Since the factor for touchpads was still
based on the physical velocity (and thus all touchpads get the same
acceleration factor for identical moves), the actual delta was dependent on
the resolution. e.g.

touchpad with 40u/mm: delta of 2/2 * accel factor 2 -> accel delta of 4/4
touchpad with 20u/mm: delta of 1/1 * accel factor 2 -> accel delta of 2/2

The normalized coordinates should be independent of the touchpad's resolution
though.

Affected by this was the standard mouse accel code and the touchpad accel
code, other filters always returned unnormalized coordinates (separate bug,
not addressed here).

This patch restores the correct behaviour for mice and touchpads
while leaving the special filters untouched. For comparision:
* 1000+dpi mice: accelerate normalized, return normalized
* touchpads: accelerate unnormalized, return normalized
* low-dpi mice: accelerate unnormalized, return unnormalized
* trackpoints: accelerate unnormalized, return unnormalized
* x230: don't touch, already does the right thing

https://bugs.freedesktop.org/show_bug.cgi?id=99383

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-19 11:56:28 +10:00
Peter Hutterer
79339bca9c filter: change the tracker delta type to device-units
We were just switching type here without actual normalization, the filter code
is in device units as of bdd4264d61.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-19 09:34:28 +10:00
Peter Hutterer
8660c19f71 gitignore: add test suite runner binary to gitignore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-18 09:10:12 +10:00
Peter Hutterer
493a7dc0f1 Update gitignore for new test source names
Fallout from 5d66edc9f4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-18 09:08:29 +10:00
Rohith Mukku
393a7ff5e9 Fix typos in Documentation
Signed-off-by: Rohith Mukku <rohithmukku@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-18 08:24:36 +10:00
Peter Hutterer
a04ba9a276 test: check if left-handed is available for the left-handed tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00