platform/upstream/libinput.git
9 years agopath: store the udev device instead of just the devnode
Peter Hutterer [Thu, 20 Nov 2014 03:50:57 +0000 (13:50 +1000)]
path: store the udev device instead of just the devnode

Long-term plan to use more of udev_device here is to better protect us against
re-opening a different device that happens to have the same devnode.

This now also prints an error message for invalid devices, the log tests are
adjusted.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agopath: split out creating a device into a helper function
Peter Hutterer [Wed, 19 Nov 2014 05:26:40 +0000 (15:26 +1000)]
path: split out creating a device into a helper function

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agopath: keep the udev context around
Peter Hutterer [Thu, 20 Nov 2014 03:36:32 +0000 (13:36 +1000)]
path: keep the udev context around

We need it for each device anyway, keep the ref around. Makes error handling a
bit easier, we don't need to handle failing udev_new() and reduce the danger
of mis-refcounting it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoRename scroll_mode to scroll_method
Peter Hutterer [Wed, 19 Nov 2014 02:16:28 +0000 (12:16 +1000)]
Rename scroll_mode to scroll_method

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: fix leaking file descriptor
Peter Hutterer [Fri, 21 Nov 2014 06:20:42 +0000 (16:20 +1000)]
evdev: fix leaking file descriptor

If zalloc fails, we need to close the fd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoDrop unused libinput_device->terminated field
Peter Hutterer [Thu, 20 Nov 2014 02:08:22 +0000 (12:08 +1000)]
Drop unused libinput_device->terminated field

Unused since commit 56f7dde "Port udev-seat to be used in libinput"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: print the device name on error
Peter Hutterer [Thu, 20 Nov 2014 04:26:10 +0000 (14:26 +1000)]
touchpad: print the device name on error

A little bit easier to recognize.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: add a few missing @ref tags
Peter Hutterer [Thu, 20 Nov 2014 01:44:02 +0000 (11:44 +1000)]
doc: add a few missing @ref tags

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add natural scrolling tests for pointers
Peter Hutterer [Tue, 18 Nov 2014 02:03:48 +0000 (12:03 +1000)]
test: add natural scrolling tests for pointers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: enable natural scrolling for all pointer devices
Peter Hutterer [Tue, 18 Nov 2014 01:38:38 +0000 (11:38 +1000)]
evdev: enable natural scrolling for all pointer devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: move natural scrolling configuration into evdev
Peter Hutterer [Tue, 18 Nov 2014 01:01:10 +0000 (11:01 +1000)]
evdev: move natural scrolling configuration into evdev

We're about to add natural scroll support to other devices as well, let's
share the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: move calibration/sendevents config init into helpers
Peter Hutterer [Tue, 18 Nov 2014 00:49:47 +0000 (10:49 +1000)]
evdev: move calibration/sendevents config init into helpers

no functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: print the device name on DEVICE_ADDED
Peter Hutterer [Tue, 18 Nov 2014 01:33:51 +0000 (11:33 +1000)]
tools: print the device name on DEVICE_ADDED

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: print config options for each device on DEVICE_ADDED
Peter Hutterer [Tue, 18 Nov 2014 01:16:24 +0000 (11:16 +1000)]
tools: print config options for each device on DEVICE_ADDED

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAllow for a 0 button on button scrolling
Peter Hutterer [Wed, 19 Nov 2014 01:22:17 +0000 (11:22 +1000)]
Allow for a 0 button on button scrolling

This effectively disables the button scrolling, but since 0 is the default
button for most devices, we should allow setting the default button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Hookup scroll-mode configuration
Hans de Goede [Tue, 4 Nov 2014 09:43:39 +0000 (10:43 +0100)]
touchpad: Hookup scroll-mode configuration

Default to 2fg scrolling for now, once we have edge-scrolling we can default
to edge-scrolling on touchpads which cannot detect more than 1 touch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: fix indentation on an if condition
Peter Hutterer [Tue, 18 Nov 2014 03:26:21 +0000 (13:26 +1000)]
evdev: fix indentation on an if condition

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: add missing break
Peter Hutterer [Tue, 18 Nov 2014 01:55:42 +0000 (11:55 +1000)]
evdev: add missing break

No effect, was the last case statement in the switch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Add button scroll test to pointer tests
Hans de Goede [Thu, 6 Nov 2014 15:35:13 +0000 (16:35 +0100)]
test: Add button scroll test to pointer tests

Non trackpoint button scrolling is mainly intended for use with trackballs,
but we can test it just as well with any relative pointer device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Add litest_button_scroll helper function
Hans de Goede [Thu, 6 Nov 2014 15:32:53 +0000 (16:32 +0100)]
test: Add litest_button_scroll helper function

Turn test_trackpoint_scroll into a generic helper function for testing
"button scrolling".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Add trackpoint middle button scrolling disable test
Hans de Goede [Thu, 6 Nov 2014 13:23:12 +0000 (14:23 +0100)]
test: Add trackpoint middle button scrolling disable test

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: s/test_2fg_scroll/test_trackpoint_scroll/
Hans de Goede [Thu, 6 Nov 2014 10:35:26 +0000 (11:35 +0100)]
test: s/test_2fg_scroll/test_trackpoint_scroll/

Fix copy and paste error, causing the function to test trackpoint scrolling
to be named test_2fg_scroll.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: s/config/config_natural/
Hans de Goede [Tue, 4 Nov 2014 08:54:07 +0000 (09:54 +0100)]
touchpad: s/config/config_natural/

To avoid confusion with scroll mode configuration.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: Hookup scroll mode configuration
Hans de Goede [Thu, 6 Nov 2014 12:39:51 +0000 (13:39 +0100)]
evdev: Hookup scroll mode configuration

Keep the default behavior of middle button scrolling on trackpoints, this
allows turning off middle button scrolling on trackpoints, as well as turning
on button scrolling on trackballs.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=85535
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: Add evdev_any_button_down helper function
Hans de Goede [Thu, 6 Nov 2014 11:47:51 +0000 (12:47 +0100)]
evdev: Add evdev_any_button_down helper function

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAdd configuration option to select scroll mode
Hans de Goede [Mon, 3 Nov 2014 13:52:59 +0000 (14:52 +0100)]
Add configuration option to select scroll mode

Add a configuration option to allow selecting between 2-finger / edge / none
scrolling (for touchpads).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAdd libinput_device_has_button function
Hans de Goede [Thu, 6 Nov 2014 11:27:35 +0000 (12:27 +0100)]
Add libinput_device_has_button function

In some cases the compositor will want to know which buttons a device has.

E.g. for scrolling we want the compositor to be able to set a button to change
a relative device (e.g. a trackball) into scroll mode, so that it sends
scroll-axis events instead of pointer motion events.

In order for the compositor to be able to present a sane UI for this, it needs
to know which buttons a device has.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoFix libinput_device_config_send_events_get_default_mode docs
Hans de Goede [Mon, 10 Nov 2014 10:59:12 +0000 (11:59 +0100)]
Fix libinput_device_config_send_events_get_default_mode docs

Fix libinput_device_config_send_events_get_default_mode docs referring to
itself, instead make it refer to libinput_device_config_send_events_get_mode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: use distance triggers to start scrolling
Peter Hutterer [Fri, 7 Nov 2014 06:08:34 +0000 (16:08 +1000)]
evdev: use distance triggers to start scrolling

The previous code used delta/event as scroll trigger which roughly translates
to speed, but depends on the sampling rate of the device.

For slow two-finger motion, a user may move the height of the touchpad without
ever triggering scrolling. Change the _initial_ trigger to a cumulative
trigger, i.e. once the user moved past the threshold distance, scrolling
starts regardless of the speed.

Once scrolling is engaged, the original trigger of threshold/event is
required to engange the second scroll direction.

Note that except for really slow movements, it's very easy to engage both
scroll directions on a touchpad. This is intentional, libinput does not have
enough semantic knowledge to know if horizontal scrolling is needed. So we
provide some direction locking but not much, it's up to the
client/toolkit/widget to decide if both scroll directions should be handled.
Add a comment to clarify that in the public doc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: explicitly init scroll settings
Peter Hutterer [Sun, 9 Nov 2014 23:24:37 +0000 (09:24 +1000)]
touchpad: explicitly init scroll settings

No effect, we're just initializing with the same value we did before. What is
important here is the comment, the touchpad scroll threshold is in mm
for touchpads providing a resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: use fabs(x) instead of (x <= -a || x >= a)
Peter Hutterer [Sun, 9 Nov 2014 22:44:11 +0000 (08:44 +1000)]
evdev: use fabs(x) instead of (x <= -a || x >= a)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: move scroll flag setting/check into a helper function
Peter Hutterer [Sun, 9 Nov 2014 22:39:58 +0000 (08:39 +1000)]
evdev: move scroll flag setting/check into a helper function

Much more readable, especially with the upcoming patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: rename a parameter to litest_assert_scroll()
Peter Hutterer [Mon, 10 Nov 2014 01:03:46 +0000 (11:03 +1000)]
test: rename a parameter to litest_assert_scroll()

This doesn't test for direction only, it tests for the minimum distance we
expect in the scroll event. Rename accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add VMWare Virtual USB Mouse device
Peter Hutterer [Thu, 6 Nov 2014 06:10:15 +0000 (16:10 +1000)]
test: add VMWare Virtual USB Mouse device

Yes, the name has VMware twice, not a typo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add Xen Virtual Pointer device
Peter Hutterer [Wed, 29 Oct 2014 02:08:20 +0000 (12:08 +1000)]
test: add Xen Virtual Pointer device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add test for absolute pointer motion
Peter Hutterer [Wed, 29 Oct 2014 01:58:09 +0000 (11:58 +1000)]
test: add test for absolute pointer motion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add QEMU tablet as test device
Peter Hutterer [Wed, 29 Oct 2014 00:59:58 +0000 (10:59 +1000)]
test: add QEMU tablet as test device

Re-uses the touch_down interface for now, but requires the slot is always 0.
That's easier for now than adding a new interface for abs event, at least
until we have more than one device that needs it.

This device, along with a couple of similar ones have a tendency to break in
the X.Org stack without people noticing. They're special in that they have
absolute x/y axes but relative wheels. For libinput that's not as much of a
problem as it is in X but let's add them anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: rename LITEST_POINTER to LITEST_RELATIVE
Peter Hutterer [Wed, 29 Oct 2014 01:05:20 +0000 (11:05 +1000)]
test: rename LITEST_POINTER to LITEST_RELATIVE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: don't ignore REL_HWHEEL values over 1
Peter Hutterer [Fri, 7 Nov 2014 00:02:56 +0000 (10:02 +1000)]
evdev: don't ignore REL_HWHEEL values over 1

Matching patch for REL_WHEEL is 09a3770961aad0973, not sure why I didn't
do both at the same time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: fix coding style
Peter Hutterer [Mon, 10 Nov 2014 00:57:27 +0000 (10:57 +1000)]
test: fix coding style

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMerge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinput
Peter Hutterer [Fri, 7 Nov 2014 01:02:22 +0000 (11:02 +1000)]
Merge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinput

9 years agoevdev: ratelimit SYN_DROPPED logging
David Herrmann [Wed, 5 Nov 2014 12:32:17 +0000 (13:32 +0100)]
evdev: ratelimit SYN_DROPPED logging

Use the ratelimit helpers for SYN_DROPPED logging. This guarantees that we
will still receive SYN_DROPPED log-messages after multiple days of
runtime, even though there might have been a SYN_DROPPED flood at one
point in time.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoutil: introduce ratelimit helpers
David Herrmann [Wed, 5 Nov 2014 12:32:16 +0000 (13:32 +0100)]
util: introduce ratelimit helpers

This adds "struct ratelimit" and "ratelimit_test()". It's a very simple
rate-limit helper modeled after Linux' lib/ratelimit.c by Dave Young.

This comes in handy to limit log-messages in possible busy loops etc..

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Make tap code follow state machine diagram part 3
Hans de Goede [Sun, 28 Sep 2014 10:51:09 +0000 (12:51 +0200)]
touchpad: Make tap code follow state machine diagram part 3

We should only mark touches dead on a button click if we're dealing with a
clickpad.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Make tap code follow state machine diagram part 2
Hans de Goede [Sun, 28 Sep 2014 10:49:06 +0000 (12:49 +0200)]
touchpad: Make tap code follow state machine diagram part 2

Mark touches as idle, rather then dead, on release. This causes no functional
changes since we only evert check for tap-touch-state == touch, and neither
being idle or dead == touch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Make tap code follow state machine diagram part 1
Hans de Goede [Thu, 6 Nov 2014 10:15:27 +0000 (11:15 +0100)]
touchpad: Make tap code follow state machine diagram part 1

According to the diagram, we should only check the tap-touch-state before
sending a button press / release when in state touch_2 or touch_3.

tp_tap_notify always checks the tap-touch-state. This is problematic when in
state tapped, or one of the follow up states, since this could cause the
button 1 release to never happen.

In practice this is never a problem since the touch passed into tp_tap_notify
is NULL when called for timeout or button events, and in the 2 affected paths
where we're dealing with a touch or release tap-touch-state always is
TAP_TOUCH_STATE_TOUCH.

However we should not rely on this and properly follow the diagram, this
commit therefor drops the touch argument to tp_tap_notify, and adds explicit
tap-touch-state checks in the places where they are present in the diagram too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Add a test for 2fg tap-n-drag release on a 3th finger down
Hans de Goede [Thu, 25 Sep 2014 14:50:44 +0000 (16:50 +0200)]
touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Don't send scroll events during 2 finger tap-n-drag
Hans de Goede [Thu, 25 Sep 2014 13:58:04 +0000 (15:58 +0200)]
touchpad: Don't send scroll events during 2 finger tap-n-drag

The touchpad tap code explicitly supports 2 finger tap-n-drag, this commit
adds a test-case for this, which fails due to the 2 finger scrolling code
sending scroll events during a 2 finger tap-n-drag.

And this commit fixes the test-case, by not sending scroll events while a
tap-n-drag is active.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Make motion during tap-n-drag test take some time
Hans de Goede [Fri, 26 Sep 2014 09:46:00 +0000 (11:46 +0200)]
touchpad: Make motion during tap-n-drag test take some time

The tap code will move individual touches to a state of TAP_TOUCH_STATE_DEAD
after a timeout. In case of tap-n-drag this should not have any influence,
make the litest_touch_move_to take long enough to trigger the timeout to
verify that this does not has any influence.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agolitest: Add a sleep_ms parameter to litest_touch_move_to
Hans de Goede [Thu, 25 Sep 2014 11:20:47 +0000 (13:20 +0200)]
litest: Add a sleep_ms parameter to litest_touch_move_to

In reality moving a touch from point to another takes time. In some cases
(when a timeout may trigger during the move, e.g. tap-n-drag on a touchpad),
this is important. Add a sleep_ms parameter, which will cause
litest_touch_move_to to sleep the specified amount of ms every step.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add the MS surface touch cover device and fake-mt tests
Peter Hutterer [Wed, 5 Nov 2014 01:20:36 +0000 (11:20 +1000)]
test: add the MS surface touch cover device and fake-mt tests

In the device description, define the interfaces for touch down/move even
though we technically don't have those interfaces. Makes it easier to test.

The fake-mt tests make sure the device shows up correctly and that no touch
events are being sent for touch events.
This device is a pointer device too, the pointer tests will test it for
correct functionality of the REL_X/Y bits, no special test needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: handle fake MT devices
Peter Hutterer [Wed, 5 Nov 2014 01:01:45 +0000 (11:01 +1000)]
evdev: handle fake MT devices

The kernel requires absolute axes to fit into the semantic ABS_ naming
scheme but doesn't provide enough free bits unlabelled axes. Devices with many
axes run into the ABS_MT range and look like MT devices when they're not.
See http://www.freedesktop.org/software/libevdev/doc/1.3/group__mt.html

Affected is e.g. the MS Surface 2 touch cover that has codes [41, 62]
set for min/max [-127, 127].

No special handling needed other than forcing has_mt/has_touch to be 0.
ABS_MT_* events from non-touch devices are discarded by libinput.

The has_mt/has_touch = 0 isn't needed, but looks nicer than an empty if
body.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: move a comment to where it belongs
Peter Hutterer [Wed, 5 Nov 2014 00:54:14 +0000 (10:54 +1000)]
evdev: move a comment to where it belongs

And s/weston/libinput/ while we're at it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: factor out resolution changing code
Peter Hutterer [Wed, 5 Nov 2014 00:51:31 +0000 (10:51 +1000)]
evdev: factor out resolution changing code

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoChange sendevents configuration to use bitmasks
Peter Hutterer [Thu, 30 Oct 2014 05:36:52 +0000 (15:36 +1000)]
Change sendevents configuration to use bitmasks

In the future, we should allow multiple sendevent modes set simultanously.
Change the API to use a bitmask instead of a single return value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Fix log_bug_libinput calls on tap enable with fingers down
Hans de Goede [Wed, 5 Nov 2014 09:48:59 +0000 (10:48 +0100)]
touchpad: Fix log_bug_libinput calls on tap enable with fingers down

Before this commit the tap code deals with enabled being set to false,
by waiting for tap.state to become IDLE, and then ignoring any events from
that point on.

This causes a problem when enabled gets set to true again while fingers are
down, because when in IDLE no release events are expected, so once a release
event for one of the fingers is send, log_bug_libinput gets called.

This commit fixes this by making enabled use the same mechanism for enabled
state transitions as the tap suspend / resume code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Disable touchpads on trackpoint activity
Hans de Goede [Sun, 28 Sep 2014 11:21:08 +0000 (13:21 +0200)]
touchpad: Disable touchpads on trackpoint activity

Some laptops with both a clickpad and a trackpoint have such a large touchpad,
that parts of the users hands will touch the pad when using the trackpoint.
Examples of this are the Lenovo T440s and the Toshiba Tecra Z40-A.

This commit makes libinput automatically disable the touchpad while using
the trackpoint on these devices, except for the buttons, as people may want
to use the touchpad (hardware or soft) buttons while using the trackpoint.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Rename consumed to filter_motion
Hans de Goede [Sun, 28 Sep 2014 11:21:07 +0000 (13:21 +0200)]
touchpad: Rename consumed to filter_motion

This is what the return value in tp_tap_handle_state is called, and it better
reflects what the flag does.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Add tap suspend / resume
Hans de Goede [Sun, 28 Sep 2014 11:21:05 +0000 (13:21 +0200)]
touchpad: Add tap suspend / resume

While e.g. disabling the touchpad while the trackpoint is used, we want to
stop sending tap (or scroll or motion) events. We cannot use tp_clear_state at
this time as that will also release any touchpad buttons pressed, breaking
dragging with the trackpoint using the touchpad or clickpad buttons.

Calling tp_release_all_taps() and then ensuring that we do not call
tp_tap_handle_state as long as the trackpoint is in use, is enough to disable
taps when the trackpoint is in use.

However when the trackpoint stops being used, we cannot simply start calling
tp_tap_handle_state() again, we first need to sync the tap.state to the current
reality, specifically if fingers are down it must be TAP_STATE_DEAD, so that
their releases do not trigger the log_bug_libinput on a release in
tp_tap_idle_handle_event.

Directly messing with tap.state from outside evdev-mt-touchpad-tap.c is not
good, so add tp_tap_suspend and tp_tap_resume functions for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Rewrite / fix tp_release_all_taps
Hans de Goede [Sun, 28 Sep 2014 11:21:04 +0000 (13:21 +0200)]
touchpad: Rewrite / fix tp_release_all_taps

Before this commit tp_release_all_taps would call tp_tap_handle_timeout, which
is a nop when in state DRAGGING. tp_clear_state then releases all touches and
calls touchpad_handle_state which moves the state to DRAGGING_WAIT, and the
button 1 release will only be done after the tap-timeout, rather then directly
as it should on tp_clear_state.

This commit fixes this by instead of calling tp_tap_handle_timeout, directly
releasing pressed buttons and switching to state DEAD or IDLE depending on
fingers_down.

Besides fixing this issue, this rewrite also makes it possible to use
tp_release_all_taps outside of tp_clear_state, which will be used to add
tap suspend / resume functionality in a follow up commit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agocore: Move libinput_event definition to libinput-private.h
Hans de Goede [Sun, 28 Sep 2014 11:21:03 +0000 (13:21 +0200)]
core: Move libinput_event definition to libinput-private.h

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agocore: Add internal event notification mechanism
Hans de Goede [Sun, 28 Sep 2014 11:21:02 +0000 (13:21 +0200)]
core: Add internal event notification mechanism

For features like e.g. disable-touchpad-while-typing, it is necessary for one
device to be able to listen into another device's events.

It is tempting to use the existing device_added / device_removed mechanism
to give e.g. the keyboard a link to the touchpad, and make the keyboard code
disable / re-enable the touchpad but this is wrong. This needs to be a setting
of the touchpad, and the policy for things like which events to count as
activity, and what sort of timeout to use to consider the device idle, belongs
in the touchpad code not in the keyboard code.

Add an event listeners mechanism so that the touchpad can listen for (e.g.)
keyboard events, and respond to these itself.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agocore: Add timestamp parameter to post_device_event
Hans de Goede [Sun, 28 Sep 2014 11:21:01 +0000 (13:21 +0200)]
core: Add timestamp parameter to post_device_event

This is a preparation patch for adding internal event listeners, so that the
callbacks for these can get the full 64 bit timestamps.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agocore: Make time argument to internal foo_notify_bar functions 64 bit
Hans de Goede [Sun, 28 Sep 2014 11:21:00 +0000 (13:21 +0200)]
core: Make time argument to internal foo_notify_bar functions 64 bit

The libinput evdev code uses 64 bit timestamps internally, to avoid having to
deal with timestamp wraps. The internal foo_notify_bar functions time argument
however is only 32 bits, bump this to 64 bits to avoid truncating the timestamps
when calling these functions.

This is a preparation patch for adding internal event listeners, so that the
callbacks for these can get the full 64 bit timestamps.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: pass an enum for the axis instead of uint
Peter Hutterer [Thu, 6 Nov 2014 04:30:21 +0000 (14:30 +1000)]
test: pass an enum for the axis instead of uint

Let's pretend that makes it type-safe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: drop superfluous empty line
Peter Hutterer [Wed, 5 Nov 2014 01:23:10 +0000 (11:23 +1000)]
test: drop superfluous empty line

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoFix documentation for libinput_log_set_handler master
Peter Hutterer [Tue, 4 Nov 2014 00:28:00 +0000 (10:28 +1000)]
Fix documentation for libinput_log_set_handler

user_data argument was dropped in 97a6bf10f958.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: add DPI to evdev calculations
Derek Foreman [Thu, 30 Oct 2014 21:34:15 +0000 (16:34 -0500)]
evdev: add DPI to evdev calculations

Assume "normal" mice are 400DPI, and that all calculations should be
normalized to this before being fed into the filter.

There isn't yet a way to configure a device's DPI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agofilter: perform speed computations with doubles
Derek Foreman [Thu, 30 Oct 2014 21:34:14 +0000 (16:34 -0500)]
filter: perform speed computations with doubles

Converting to integer before the sqrt calculation can cause loss of
motion at low speed.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agofilter: Fix typo
Derek Foreman [Thu, 30 Oct 2014 21:34:13 +0000 (16:34 -0500)]
filter: Fix typo

accelator -> accelerator

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: Log evdev event queue overflows
Derek Foreman [Wed, 29 Oct 2014 14:56:27 +0000 (09:56 -0500)]
evdev: Log evdev event queue overflows

Log a message when the kernel event queue overflows and events are dropped.
After 10 messages logging stops to avoid flooding the logs if the condition
is persistent.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoFix a documentation typo
Peter Hutterer [Thu, 30 Oct 2014 05:36:16 +0000 (15:36 +1000)]
Fix a documentation typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: update for latest doxygen
Peter Hutterer [Thu, 30 Oct 2014 05:16:40 +0000 (15:16 +1000)]
doc: update for latest doxygen

doxygen -u, no manual interference.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agocosmetic: convert evdev_need_touch_frame from int to bool
Derek Foreman [Fri, 3 Oct 2014 20:01:35 +0000 (15:01 -0500)]
cosmetic: convert evdev_need_touch_frame from int to bool

We use stdbool elsewhere, so use it here too for consistency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add some left-handed tests
Peter Hutterer [Tue, 23 Sep 2014 02:46:02 +0000 (12:46 +1000)]
test: add some left-handed tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: hook up left-handed configuration
Peter Hutterer [Tue, 23 Sep 2014 04:35:42 +0000 (14:35 +1000)]
touchpad: hook up left-handed configuration

Tapping and clickfinger is unaffected, physical and software buttons are
swapped. The main area of a clickpad remains as left button though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: hook up left-handed configuration option
Peter Hutterer [Tue, 23 Sep 2014 03:48:06 +0000 (13:48 +1000)]
evdev: hook up left-handed configuration option

Two separate flags needed, want_left_handed and left_handed to avoid switching
to left_handed while a button is still down. Since each backend has a
different way of determining whether buttons are down, let them set a function
to do exactly that. Then call that function whenever a button release event is
posted to switch the device to right/left-handed if applicable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAdd configuration option for left-handed behavior
Peter Hutterer [Mon, 22 Sep 2014 06:48:41 +0000 (16:48 +1000)]
Add configuration option for left-handed behavior

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add litest_push/pop_event_frame() helpers
Peter Hutterer [Wed, 17 Sep 2014 00:07:38 +0000 (10:07 +1000)]
test: add litest_push/pop_event_frame() helpers

For some tests we need to string multiple event sequences together into one
event frame. Use a push/pop frame approach that stops litest from sending any
EV_SYN/SYN_REPORT events, so we can merge two touches together by e.g.

litest_push_event_frame(d);
litest_touch_down(d, 0, 10, 10);
litest_touch_down(d, 1, 20, 50);
litest_pop_event_frame(d);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add helper functions for the two timers we care about
Peter Hutterer [Tue, 16 Sep 2014 06:08:29 +0000 (16:08 +1000)]
test: add helper functions for the two timers we care about

Rather than a random msleep() with a comment, use a helper function that
describes what we're waiting for. Also makes changing the timeouts easier in
the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAdd missing doxygen @ingroup commands
Peter Hutterer [Mon, 22 Sep 2014 06:37:36 +0000 (16:37 +1000)]
Add missing doxygen @ingroup commands

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add tests for natural scrolling
Peter Hutterer [Thu, 18 Sep 2014 06:14:35 +0000 (16:14 +1000)]
test: add tests for natural scrolling

2-finger scrolling only, we don't have anything else yet

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: hook up natural scrolling configuration
Peter Hutterer [Thu, 18 Sep 2014 05:51:53 +0000 (15:51 +1000)]
touchpad: hook up natural scrolling configuration

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAdd a configuration option for natural scrolling
Peter Hutterer [Thu, 18 Sep 2014 05:10:19 +0000 (15:10 +1000)]
Add a configuration option for natural scrolling

Natural scrolling is simply inverted scrolling, but I decided to
use the Apple terminology simply because it's easier to google for.

Add the usual quartett of config options for has/set/get/get_default/, as a
boolean option rather than an enum for scroll mode to avoid name collusion
with the (currently in the works) edge scrolling.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: map KEY_UP/DOWN to pointer acceleration
Peter Hutterer [Thu, 3 Jul 2014 23:04:10 +0000 (09:04 +1000)]
tools: map KEY_UP/DOWN to pointer acceleration

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: keep a list of devices around for run-time changes
Peter Hutterer [Thu, 3 Jul 2014 22:56:44 +0000 (08:56 +1000)]
tools: keep a list of devices around for run-time changes

Hard-coded to 50 devices, because for a debugging tool that's plenty.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: hook up pointer acceleration configuration
Peter Hutterer [Thu, 3 Jul 2014 23:44:43 +0000 (09:44 +1000)]
touchpad: hook up pointer acceleration configuration

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: hook into pointer acceleration config interface
Peter Hutterer [Fri, 19 Sep 2014 05:09:31 +0000 (15:09 +1000)]
evdev: hook into pointer acceleration config interface

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAdd a pointer acceleration API
Peter Hutterer [Thu, 15 May 2014 05:46:19 +0000 (15:46 +1000)]
Add a pointer acceleration API

Only exposes one knob - speed, normalized to a [-1, 1] range with 0 being the
neutral "this is what we think is normal" speed. -1 and 1 reflect the
slowest/fastest reasonable speed on this device.

Note: with this API we commit to having any pointer accelerating as a true
gliding scale. We cannot map the [-1,1] range into a discrete set of steps
as we do not communicate to the caller whether a specific value has changed
the acceleration. Without that, a caller may assume that acceleration has
changed even when it is not visible to the user.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: use the evdev device's filter struct
Peter Hutterer [Sun, 21 Sep 2014 23:35:53 +0000 (09:35 +1000)]
touchpad: use the evdev device's filter struct

We don't need a separate filter struct, we can use the parent evdev device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agofilter: adjust acceleration curve depending on speed
Peter Hutterer [Fri, 19 Sep 2014 04:25:22 +0000 (14:25 +1000)]
filter: adjust acceleration curve depending on speed

The acceleration curve consists of four parts, in ascii-art like this:
        _____________
       /
  ____/
 /
/

where the x axis is the speed, y is the acceleration factor.
The first plateau is at the acceleration factor 1 (i.e. unaccelerated
movement), the second plateau is at the max acceleration factor. The threshold
in the code defines where and how long the plateau is.

This patch adjusts the curve based on a [-1, 1] range. For anything below 0,
the plateau is longer (i.e. accel kicks in at a higher speed), the second
incline is flatter (i.e. accel kicks in slower) and the max accel factor is
lower (i.e. maximum speed is slower). For anything above 0, the inverse is
true, acceleration kicks in earlier, harder and is faster in general. So the
default/min/max curves overlaid look something like this:
      ________ max
     | _______ default
    | /  _____ min
  _|_/_/
 /
/

Note that there's a limit to what ascii art can do...

Note that there are additional tweaks we can introduce later, such as
decreaseing the unaccelerated speed of the device (i.e. lowering the first
plateau).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agofilter: add a configurable speed interface
Peter Hutterer [Thu, 3 Jul 2014 05:53:56 +0000 (15:53 +1000)]
filter: add a configurable speed interface

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agofilter: move the threshold/accel into the filter struct
Peter Hutterer [Thu, 3 Jul 2014 05:32:40 +0000 (15:32 +1000)]
filter: move the threshold/accel into the filter struct

No functional changes, prep work for the config interface.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agofilter: add a filter-private.h header file
Peter Hutterer [Thu, 3 Jul 2014 23:29:11 +0000 (09:29 +1000)]
filter: add a filter-private.h header file

To keep the implementation of a filter separate from the users of a filter.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoReplace pointer acceleration with a much simpler linear one
Peter Hutterer [Fri, 19 Sep 2014 01:10:17 +0000 (11:10 +1000)]
Replace pointer acceleration with a much simpler linear one

We ran a userstudy, evaluating three different accel methods. Detailed results are
available at:
http://www.who-t.net/publications/hutterer2014_libinput_ptraccel_study.pdf

We found that there was little difference between the method we had in
libinput 0.6 and this three-line function. Users didn't really notice a
difference, but measured data suggests that it has slight advantages in some
use-cases.

The method proposed here is the one labeled "linear" in the paper, its profile
looks roughly like this:

        _____________
       /
  ____/
 /
/

where the x axis is the speed, y is the acceleration factor.
The first plateau is at the acceleration factor 1 (i.e. unaccelerated
movement), the second plateau is at the max acceleration factor. The threshold
in the code defines where and how long the plateau is.

Differences to the previous accel function:
- both inclines are linear rather than curved
- the second incline is less steep than the current method

From a maintainer's point-of-view, this function is significantly easier to
understand and manipulate than the previous one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoDrop two semicolons after a macro definition
Peter Hutterer [Wed, 17 Sep 2014 05:11:41 +0000 (15:11 +1000)]
Drop two semicolons after a macro definition

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: drop unused declaration evdev_proces_event
Peter Hutterer [Sun, 21 Sep 2014 23:30:38 +0000 (09:30 +1000)]
evdev: drop unused declaration evdev_proces_event

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Add trackpoint middlebutton scrolling tests
Hans de Goede [Thu, 18 Sep 2014 09:15:27 +0000 (11:15 +0200)]
test: Add trackpoint middlebutton scrolling tests

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolitest: Add litest_assert_scroll() helper function
Hans de Goede [Wed, 17 Sep 2014 13:35:31 +0000 (15:35 +0200)]
litest: Add litest_assert_scroll() helper function

Make check_2fg_scroll functionality available outside of touchpad.c ,
no functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Enlarge topbutton area a bit while the touchpad is disabled
Hans de Goede [Wed, 17 Sep 2014 13:35:30 +0000 (15:35 +0200)]
touchpad: Enlarge topbutton area a bit while the touchpad is disabled

Make it easier to hit the topbutton area when the touchpad is disabled,
normally we don't want to make the topbutton area too big, so as to not
interfere with normal touchpad operation, but when disabled we have no such
worries.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>