Commit graph

1460 commits

Author SHA1 Message Date
Peter Hutterer
7272696666 test: drop unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
411a3a4766 tablet: add axis smoothing
Taking the tablet events as-is produces the occasional wobble in what should
be a straight line. Bug 99961 has a jpg attachment to illustrate that.
Emulate the wacom driver behavior and average x/y across the last 4 values to
smoothen out these dents.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
eb8cfa301a test: add missing linebreak to error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
bb4f90de0b test: fix tablet touch arbitration case
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
c2b33f2a53 test: don't use the same mouse twice
No effect since we don't care about the mouse itself. But when running
on kernels without uinput's UI_GET_SYSNAME this can cause misdetection of
the uinput device and test case failures. Simply picking a differently named
device avoids that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
b51546314f test: drop ABS_MT_PRESSURE from the bcm5974
This device only sends ABS_PRESSURE

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-08 14:44:26 +10:00
Peter Hutterer
c0dbd6eb38 touchpad: ignore hovering touches for the software button state
If a touch started hovering in the main area, the button state would start
with AREA and never move to the real button state, despite the finger
triggering the pressure thresholds correctly in one of the areas.

This could even happen across touch sequences if a touch went below pressure
in the software button area, it changed to hovering and the button state
changed to NONE. On the next event, the touch is still hovering and the
current position of the touch is taken for the button state machine.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-03-02 08:34:17 +10:00
Peter Hutterer
d6379bc3f3 touchpad: reduce minimum height for horiz edge scrolling to 40mm
Introduced in commit 8e7f99c27a we only allowed horizontal edge scrolling
on devices larger than 50mm to leave enough reactive space on the touchpad.
Looking at a ruler, a 50mm high touchpad is still large enough to leave the
bottom 7mm as an horizontal edge scroll area. Reduce the minimum size to 40mm
instead, that's closer to where it starts to get a bit iffy.

https://bugzilla.redhat.com/show_bug.cgi?id=1422221

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-28 11:32:08 +10:00
Peter Hutterer
dbefce8ffe test: add a has_slider check for the airbrush tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-22 10:00:17 +10:00
Peter Hutterer
c225c0592c evdev: don't provide button scrolling on absolute pointer devices
This may be a feature for the future but for now be honest and don't claim
that button-based scrolling is available, it's not hooked up in the absolute
code path.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 21:43:45 +10:00
Peter Hutterer
6a2870f5ca evdev: add "READY" state to button scrolling
Before, our states were idle, button down and scrolling. This adds a state
where the button is down and the timeout has expired (i.e. we're ready to send
scroll events) but we haven't actually sent any events anymore.

If the button is released in this state, we generate a normal click event.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 21:16:34 +10:00
Peter Hutterer
bcf8c222cb test: add tests for middle button + button scrolling on BTN_LEFT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 13:51:37 +10:00
Peter Hutterer
f7f849e576 evdev: add quirk for Logitech Marble Mouse
Device needs BTN_MIDDLE disabled, this way middle button emulation is present
by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:25:05 +10:00
Peter Hutterer
53e263fce7 test: fix the pointer scroll-defaults test
The button-scroll by default behavior is only true on devices with a middle
button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:26 +10:00
Peter Hutterer
72c5821a3b test: skip two tests when middle button is missing
And disable middle button emulation for this test, it would mess with the test
results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:22 +10:00
Peter Hutterer
9ab05b0bfd test: fix middle button defaults test
This failed on devices without a middle button, we just didn't have a test
device to trigger this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:17:05 +10:00
Peter Hutterer
42b68397f9 test: check the libinput device for BTN_MIDDLE, not the libevdev device
We don't have the same libevdev context that libinput has so if libinput
disables/enables event codes we don't see that and may get unexpected
behavior in the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-20 12:16:02 +10:00
Peter Hutterer
6b561d4505 test: fix udev rule for waltop tablet test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-17 15:39:31 +10:00
Peter Hutterer
019f185107 touchpad: add a hwdb quirk for (external) touchpad/keyboard combos
Specify the layout of the combo so we know when to initialize palm detection.

This allows us to drop palm detection on external touchpads otherwise,
replacing the wacom-specific check with something more generic..

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-13 08:28:37 +10:00
Peter Hutterer
be30b28a12 Merge branch 'gcov-tests'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 12:27:39 +10:00
Peter Hutterer
02b18d112c test: add tests for tablet tool types
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 11:54:04 +10:00
Peter Hutterer
2dd9b77c9d test: add helper functions to filter an event
Simplest implementation for what we need right now, it turns off an event on
the evdev device and turns it back on again. This allows us to change bits in
the 'normal' event stream, such as changing the tool type without triggering
proximity events for the BTN_TOOL_PEN that all test devices send by default.

This won't work for absolute devices because we need to re-enable with a
struct input_absinfo. But we don't need that ability for now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 11:54:03 +10:00
Peter Hutterer
47fbd8f98f test: add basic test for getting the physical seat name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 11:54:03 +10:00
Peter Hutterer
784241427b evdev: split calibration property parsing into a helper
So we can test it externally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 11:54:03 +10:00
Peter Hutterer
07860e5db6 path: parse the WL_OUTPUT property for patch devices too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 11:54:03 +10:00
Peter Hutterer
f2f616a1fc touchpad: mark the Apple onebutton touchpad as clickfinger-default
We don't initialize click methods on devices with physical buttons. This model
is a special case, it's not a clickpad but it only has one button (because one
button is all you ever need and whatnot).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-09 09:26:07 +10:00
Peter Hutterer
2908ba98cd test: add test for touch seat slots
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:47:56 +10:00
Peter Hutterer
6d8a256bd4 Swap the return values for unsupported scroll button configs
Usually we reply INVALID before we reply UNSUPPORTED but that's only for those
values where the value is a programming error. But in this case it's a bit
more complicated. INVALID is only for the cases where the button doesn't exist
on the device, if we don't have button scrolling at all then we have
UNSUPPORTED for all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:23:18 +10:00
Peter Hutterer
7735f3aa4e test: add test for setting pointer accel profiles on no-accel devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:06:48 +10:00
Peter Hutterer
6fded79d4b test: test click method setting on non-touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:03:43 +10:00
Peter Hutterer
f954b8f853 test: add test for pad event mode groups
Not much we can do here, our virtual devices don't have the sysfs files
required, so they have 0 modes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 11:00:43 +10:00
Peter Hutterer
e5f8ac7579 test: add missing checks for tap enabled/disabled by default
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 10:51:25 +10:00
Peter Hutterer
a7720d3625 test: add test for natural scroll defaults on no-scroll devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 10:48:13 +10:00
Peter Hutterer
d634917c26 test: add test for default button tap map (on non-tapping devices)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-06 10:46:13 +10:00
Peter Hutterer
00d6b908d3 Merge branch 'touchpad-pressure-based-v2' 2017-02-03 11:41:06 +10:00
Peter Hutterer
b9b0f368cb test: fix ranged test for 'no device' tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-02 17:11:28 +10:00
Peter Hutterer
45d7794de2 Merge branch 'wip/switch-interface' 2017-02-01 13:56:32 +10:00
Peter Hutterer
65c4b27260 test: fail before zero division
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-01 13:12:57 +10:00
Peter Hutterer
776c55f636 test: fix tablet tool_id test to fail on unexpected ids
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-01 13:11:23 +10:00
Peter Hutterer
dc15a42d6c switch: for surface 3 tablets, write the lid open to the device
These tablets only ever give us a close event, the open event is broken. So
when we detect keyboard events, fix the kernel device's state by writing the
event to the fd.

We still sync the lid state manually, in case this fails and we don't get the
SW_LID through the normal event sequence. If it works fine, the real open
event will just be ignored.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 15:26:45 +10:00
Peter Hutterer
078564ce7a test: fix two test udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 15:26:44 +10:00
Peter Hutterer
9672e2f407 test: fix two test udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-30 13:36:20 +10:00
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