platform/upstream/libinput.git
6 years agodoc: use @verbatim, not @code for shell commands
Peter Hutterer [Thu, 21 Jun 2018 01:08:17 +0000 (11:08 +1000)]
doc: use @verbatim, not @code for shell commands

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: update docs to drop hwdb references
Peter Hutterer [Thu, 21 Jun 2018 00:58:34 +0000 (10:58 +1000)]
doc: update docs to drop hwdb references

In favour of the device quirks system.

Fixes #55

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agozalloc limit fix for libinput-record
Sergiusz Michalik [Wed, 20 Jun 2018 17:34:28 +0000 (19:34 +0200)]
zalloc limit fix for libinput-record

6 years agodata: lenovo: fix device name for the X1 Carbon 6th
Peter Hutterer [Wed, 20 Jun 2018 03:07:38 +0000 (13:07 +1000)]
data: lenovo: fix device name for the X1 Carbon 6th

Possibly a typo, who knows.

https://gitlab.freedesktop.org/libinput/libinput/issues/46

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: list-quirks: add the thumb pressure threshold property
Peter Hutterer [Tue, 19 Jun 2018 06:47:45 +0000 (16:47 +1000)]
tools: list-quirks: add the thumb pressure threshold property

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: list-quirks: fix usage to read "libinput list-quirks"
Peter Hutterer [Tue, 19 Jun 2018 06:43:52 +0000 (16:43 +1000)]
tools: list-quirks: fix usage to read "libinput list-quirks"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: list-quirks: compress a condition
Peter Hutterer [Tue, 19 Jun 2018 05:45:35 +0000 (15:45 +1000)]
tools: list-quirks: compress a condition

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: drop the JUMPING_SEMI_MT model
Peter Hutterer [Tue, 19 Jun 2018 06:48:58 +0000 (16:48 +1000)]
quirks: drop the JUMPING_SEMI_MT model

Removed from the udev properties in a55693f87c58c24b6866ed0f38c5470124be3df7
but survived here while the branch was in process.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agomeson.build: add more overrides for coverity
Peter Hutterer [Wed, 20 Jun 2018 00:13:47 +0000 (10:13 +1000)]
meson.build: add more overrides for coverity

"/usr/include/math.h", line 381: error #20: identifier "_Float32" is undefined
  # define _Mdouble_ _Float32

Same for a few others. Since we don't actually need those anyway, we can just
cast those to the some close-enough sizes. We don't have stdint.h in config.h
and meson cannot have a custom #include line in the config object. So let's go
with what does the job for now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
6 years agoutil: abort if we try to allocate more than a MB
Peter Hutterer [Tue, 19 Jun 2018 23:34:30 +0000 (09:34 +1000)]
util: abort if we try to allocate more than a MB

The ssize_t cast upsets coverity for some reason but we can be a lot more
restrictive here anyway. Quick analysis of the zalloc calls in the test suite
show the largest allocation is 9204 bytes.

Let's put a cap on for one MB, anything above that is likely some memory
corruption and should be caught early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
6 years agomeson.build: add a libinput list-devices run to the test suite
Peter Hutterer [Tue, 19 Jun 2018 22:15:14 +0000 (08:15 +1000)]
meson.build: add a libinput list-devices run to the test suite

This will only catch a segfault or some other bug since we don't actually look
at the output. But that's still better than not running it at all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: list-devices: unref the udev device
Peter Hutterer [Tue, 19 Jun 2018 23:54:25 +0000 (09:54 +1000)]
tools: list-devices: unref the udev device

Fixes a memory leak that prevents us from running list-devices in valgrind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: pass a valid grab parameter to list-devices
Peter Hutterer [Tue, 19 Jun 2018 21:56:05 +0000 (07:56 +1000)]
tools: pass a valid grab parameter to list-devices

My kingdome for a compiler warning. Or a scan-build warning. Or a coverity
warning. Or anything... But no, nothing.

Also make the open_restricted() more robust to a NULL userdata, because
effectively that's what we were passing here.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/50

Introduced in 0a13223c39fdf0f079715bf83d498c0dcd9cf4f8

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCI: WIP: attempt to clean up the registry before leaving
Benjamin Tissoires [Mon, 18 Jun 2018 13:13:17 +0000 (15:13 +0200)]
CI: WIP: attempt to clean up the registry before leaving

According to multiple sources, referenced in
https://engineering.facile.it/blog/eng/continuous-deployment-from-gitlab-ci-to-k8s-using-docker-in-docker/

The garbage collector of the registry won't clean up docker images that
still have blob references. We should clean up the manifests instead
of simply overwriting the tag.

Note: this requires to set up a personal token with api access from the
maintainers in the form of (for instance): "PERSONAL_TOKEN_bentiss"

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoCI: speed up the docker_check stage
Benjamin Tissoires [Mon, 18 Jun 2018 07:34:10 +0000 (09:34 +0200)]
CI: speed up the docker_check stage

There is no point in login in to the registry if there is no need to
create a new docker image.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoCI: do not pull images when checking for the creation date
Benjamin Tissoires [Fri, 15 Jun 2018 20:15:40 +0000 (22:15 +0200)]
CI: do not pull images when checking for the creation date

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agodoc: point to the gitlab ci file for a list of required packages
Peter Hutterer [Tue, 19 Jun 2018 03:27:42 +0000 (13:27 +1000)]
doc: point to the gitlab ci file for a list of required packages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: remove a compiler warning
Peter Hutterer [Tue, 19 Jun 2018 03:13:24 +0000 (13:13 +1000)]
test: remove a compiler warning

Leftover from a previous iteration of this code - having a static but
unnecessarily large size for dirname results in:

../test/litest.c:1251:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
   snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
                                      ^
../test/litest.c:1251:3: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096
   snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add more assertion to avoid API misusage (v2)
Peter Hutterer [Tue, 19 Jun 2018 03:07:12 +0000 (13:07 +1000)]
quirks: add more assertion to avoid API misusage (v2)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "quirks: add more assertion to avoid API misusage"
Peter Hutterer [Mon, 18 Jun 2018 10:55:03 +0000 (20:55 +1000)]
Revert "quirks: add more assertion to avoid API misusage"

Ooops, this clearly didn't get tested and now aborts libinput list-quirks

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/47

This reverts commit 2c4f963b18ff7f36cc14994c8b18bc4e4754ddde.

6 years agotest: pass the open mode to open(O_CREAT)
Peter Hutterer [Mon, 18 Jun 2018 03:41:18 +0000 (13:41 +1000)]
test: pass the open mode to open(O_CREAT)

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add more assertion to avoid API misusage
Peter Hutterer [Mon, 18 Jun 2018 03:35:34 +0000 (13:35 +1000)]
quirks: add more assertion to avoid API misusage

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: explicitly cast the log priority
Peter Hutterer [Mon, 18 Jun 2018 03:27:57 +0000 (13:27 +1000)]
quirks: explicitly cast the log priority

The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirk: remove unused variable
Peter Hutterer [Mon, 18 Jun 2018 03:25:02 +0000 (13:25 +1000)]
quirk: remove unused variable

Also fixes a coverity complaint about incrementing an uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agogitlab ci: use GIT_DEPTH of 1
Peter Hutterer [Mon, 18 Jun 2018 02:35:42 +0000 (12:35 +1000)]
gitlab ci: use GIT_DEPTH of 1

We don't need the full repo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoDrop the udev hwdb model quirks
Peter Hutterer [Mon, 18 Jun 2018 01:04:43 +0000 (11:04 +1000)]
Drop the udev hwdb model quirks

Replaced with the quirks files in merge commit
000ac14c27f1920fc84c0ecb1512eb7495e67634

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRemove circle.yml
Peter Hutterer [Mon, 18 Jun 2018 01:00:23 +0000 (11:00 +1000)]
Remove circle.yml

This has been replaced with the GitLab CI in the repository proper. Circle CI
was ony ever run on a private github repo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/quirks-fixes'
Peter Hutterer [Mon, 18 Jun 2018 00:55:27 +0000 (10:55 +1000)]
Merge branch 'wip/quirks-fixes'

6 years agodata: don't disable the keyboard on any Thinkpad Yoga models
Peter Hutterer [Thu, 14 Jun 2018 01:33:41 +0000 (11:33 +1000)]
data: don't disable the keyboard on any Thinkpad Yoga models

These (probably) all disable the mechanical keyboard anyway, so let's keep it
enabled to be able to access the screen keys, if any.

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add the alps firmware version LUT
Peter Hutterer [Thu, 14 Jun 2018 01:57:42 +0000 (11:57 +1000)]
data: add the alps firmware version LUT

Just in case we need it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: put a 'do not edit' warning into all data files
Peter Hutterer [Thu, 14 Jun 2018 01:54:52 +0000 (11:54 +1000)]
data: put a 'do not edit' warning into all data files

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add ALPS v8 trackpoint range
Peter Hutterer [Thu, 14 Jun 2018 01:48:33 +0000 (11:48 +1000)]
data: add ALPS v8 trackpoint range

Got lost in the hwdb to quirks conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: re-add the ALPS v8 size hint
Peter Hutterer [Thu, 14 Jun 2018 01:47:50 +0000 (11:47 +1000)]
data: re-add the ALPS v8 size hint

Got lost in the udev to quirks file conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: switch alps touchpad matching to the bus/vid/pid matching
Peter Hutterer [Thu, 14 Jun 2018 01:44:48 +0000 (11:44 +1000)]
data: switch alps touchpad matching to the bus/vid/pid matching

PSMOUSE_ALPS is 0x8

https://gitlab.freedesktop.org/libinput/libinput/issues/30

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add MatchVersion in addition to VID/PID
Peter Hutterer [Thu, 14 Jun 2018 01:42:27 +0000 (11:42 +1000)]
quirks: add MatchVersion in addition to VID/PID

Needed for the ALPS firmware detection in #39

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: re-add the IBM X41 quirk
Peter Hutterer [Thu, 14 Jun 2018 01:36:44 +0000 (11:36 +1000)]
data: re-add the IBM X41 quirk

Was merged while the config branch was ongoing and got lost in the process.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCI: Hook up GitLab CI
Benjamin Tissoires [Mon, 11 Jun 2018 09:22:41 +0000 (11:22 +0200)]
CI: Hook up GitLab CI

The main tasks it does is build on a few different distros as well as build
with the various build options to make sure they work.It doesn't (yet) run the
test suite runner because that one mostly requires device nodes to operate on.

Most of the fancy is to get the docker images ready. A dnf update takes
forever, so we don't want to do that on 10 different machines. So instead we
build docker images with all the bits pre-installed, push that to the registry
and use those images for testing.

To speed things up, we only do that when the current image is older than a
week. And we only do that when we push to libinput proper, so a merge request
or pushing to your private gitlab repo will never trigger a docker image
update - it will trigger the tests and use the docker images tough.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agotools: measure touchpad-pressure: prevent division by zero
Peter Hutterer [Sun, 17 Jun 2018 22:38:58 +0000 (08:38 +1000)]
tools: measure touchpad-pressure: prevent division by zero

And make sure the equivalent entry in the measure touch-size is long enough to
overwrite the current status line

https://gitlab.freedesktop.org/libinput/libinput/issues/42

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: ignore motion on finger-up
Konstantin Kharlamov [Wed, 13 Jun 2018 11:38:20 +0000 (14:38 +0300)]
touchpad: ignore motion on finger-up

Ignore motion when pressure/touch size fell below the threshold, thus
ending the touch.

Real world significance: subjectively scrolling/cursor positioning with
a touchpad now a bit better on SAMSUNG NP305V5A laptop.

https://gitlab.freedesktop.org/libinput/libinput/merge_requests/4

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
6 years agoquirks: use realloc instead of reallocarray
Peter Hutterer [Thu, 14 Jun 2018 21:59:06 +0000 (07:59 +1000)]
quirks: use realloc instead of reallocarray

The latter requires libbsd and for that one call it's not worth it

https://gitlab.freedesktop.org/libinput/libinput/issues/40

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix a test device section name
Peter Hutterer [Thu, 14 Jun 2018 05:16:03 +0000 (15:16 +1000)]
test: fix a test device section name

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix the input_id struct for the ALPS touchpad
Peter Hutterer [Thu, 14 Jun 2018 05:17:46 +0000 (15:17 +1000)]
test: fix the input_id struct for the ALPS touchpad

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agomeson.build: always build some tests
Peter Hutterer [Thu, 14 Jun 2018 04:48:49 +0000 (14:48 +1000)]
meson.build: always build some tests

Make the meson -Dtests=false option only apply to the libinput test suite
itself which has extra dependencies, etc. The build tests and symbol leak
tests should always run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add pressure range/palm threshold for the Dell XPS13 9333
Peter Hutterer [Thu, 14 Jun 2018 00:04:35 +0000 (10:04 +1000)]
data: add pressure range/palm threshold for the Dell XPS13 9333

https://gitlab.freedesktop.org/libinput/libinput/issues/37

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix grab argument passing for libinput debug-events
Peter Hutterer [Wed, 13 Jun 2018 03:38:09 +0000 (13:38 +1000)]
tools: fix grab argument passing for libinput debug-events

The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

https://gitlab.freedesktop.org/libinput/libinput/issues/26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMove CODING_STYLE to markdown
Peter Hutterer [Wed, 13 Jun 2018 22:39:28 +0000 (08:39 +1000)]
Move CODING_STYLE to markdown

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: replace last_point with history.samples
Konstantin Kharlamov [Tue, 12 Jun 2018 15:53:51 +0000 (18:53 +0300)]
touchpad: replace last_point with history.samples

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
6 years agomeson.build: bump to 1.11.900
Peter Hutterer [Wed, 13 Jun 2018 05:45:27 +0000 (15:45 +1000)]
meson.build: bump to 1.11.900

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agocircleci: drop the separate libsolv update
Peter Hutterer [Wed, 13 Jun 2018 05:22:24 +0000 (15:22 +1000)]
circleci: drop the separate libsolv update

This was a F26 bug that is well and truly in stable by now
https://bugzilla.redhat.com/show_bug.cgi?id=1483553

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/config-files'
Peter Hutterer [Mon, 11 Jun 2018 03:45:50 +0000 (13:45 +1000)]
Merge branch 'wip/config-files'

6 years agotools: libinput-record: put extra guard in to protect from OOB access
Peter Hutterer [Mon, 11 Jun 2018 01:20:09 +0000 (11:20 +1000)]
tools: libinput-record: put extra guard in to protect from OOB access

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: abort for a negative zalloc() size
Peter Hutterer [Mon, 11 Jun 2018 01:13:03 +0000 (11:13 +1000)]
util: abort for a negative zalloc() size

Nothing in libinput needs large buffers, so if we ever get something that
large, we probably passed a negative number to zalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: put limits on how many strings we join
Peter Hutterer [Mon, 11 Jun 2018 03:43:20 +0000 (13:43 +1000)]
util: put limits on how many strings we join

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add null string test handling to strv_join
Peter Hutterer [Mon, 11 Jun 2018 00:45:58 +0000 (10:45 +1000)]
util: add null string test handling to strv_join

Make it return NULL for a string array in the form of [ NULL ], like the docs
say. This also adds an extra safety check for the joiner to be of a reasonable
length to avoid overflows.

Found in
https://gitlab.freedesktop.org/libinput/libinput/issues/26#note_6320

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: don't pair external touchpads with lid/tablet mode switches
Peter Hutterer [Fri, 8 Jun 2018 05:15:24 +0000 (15:15 +1000)]
touchpad: don't pair external touchpads with lid/tablet mode switches

https://gitlab.freedesktop.org/libinput/libinput/issues/29

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoHook up list-quirks --validate for the test suite
Peter Hutterer [Wed, 6 Jun 2018 04:39:39 +0000 (14:39 +1000)]
Hook up list-quirks --validate for the test suite

All the tests fill fail anyway if the validation fails but this is a quick way
to fail everything early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add the devicetree implementation
Peter Hutterer [Mon, 4 Jun 2018 01:18:02 +0000 (11:18 +1000)]
quirks: add the devicetree implementation

Using the compatible string

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoSwitch from udev property parsing to the quirks system
Peter Hutterer [Thu, 24 May 2018 01:56:24 +0000 (11:56 +1000)]
Switch from udev property parsing to the quirks system

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: initialize the quirks subsystem
Peter Hutterer [Thu, 24 May 2018 01:46:31 +0000 (11:46 +1000)]
libinput: initialize the quirks subsystem

A bit quirky (haha), because we cannot do this during context creation - we
really want any parsing error messages to show up in the right log file and
the log handler isn't set up during context creation. So we do it on the first
real call to the backend - path_add_device or udev_assign_seat.

Also, failure to initialize the quirks subsystem just means we continue as
normal. This shouldn't be a hard failure, it just means a lot of devices won't
work properly.

If the LIBINPUT_DATA_DIR environment variable is set, that directory is used
for the data file. Only that directory, no custom override file in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: switch the udev tag tests to be quirk tests
Peter Hutterer [Fri, 25 May 2018 00:01:47 +0000 (10:01 +1000)]
test: switch the udev tag tests to be quirk tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: init the quirks once per test suite run
Peter Hutterer [Thu, 24 May 2018 06:52:42 +0000 (16:52 +1000)]
test: init the quirks once per test suite run

So we have them available per litest device and can check in tests for certain
quirks to be present.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: install per-test device quirks files
Peter Hutterer [Thu, 24 May 2018 05:36:22 +0000 (15:36 +1000)]
test: install per-test device quirks files

These will replace the custom udev rules we currently have in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: allow for in-line comments
Peter Hutterer [Wed, 30 May 2018 23:42:15 +0000 (09:42 +1000)]
quirks: allow for in-line comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: use an empty dmi modalias string for the test suite
Peter Hutterer [Thu, 24 May 2018 23:23:50 +0000 (09:23 +1000)]
quirks: use an empty dmi modalias string for the test suite

We don't want any of the test devices to match the local machine's DMI
modalias. This was a major drawback in the previous test suite, hacking the
dmi modalias string was nontrivial but a wrong string could cause false
positives or negatives.

The quirks system is internal, so rather than having some fancy API we just
hook it off the environment variable that the test suite always sets. Hacky,
but a lot easier than the other options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoImplement a quirks system to replace the udev property parsing
Peter Hutterer [Mon, 21 May 2018 04:28:53 +0000 (14:28 +1000)]
Implement a quirks system to replace the udev property parsing

Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.

This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.

The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.

Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.

THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: remove duplicate Chromebook Falco hwdb entry
Peter Hutterer [Wed, 30 May 2018 05:23:21 +0000 (15:23 +1000)]
udev: remove duplicate Chromebook Falco hwdb entry

We can expand the first one and re-use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a safe_atou() as unsigned equivalent to safe_atoi()
Peter Hutterer [Fri, 1 Jun 2018 00:21:18 +0000 (10:21 +1000)]
util: add a safe_atou() as unsigned equivalent to safe_atoi()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a list_append()
Peter Hutterer [Wed, 23 May 2018 05:21:56 +0000 (15:21 +1000)]
util: add a list_append()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: remove created directories too
Peter Hutterer [Thu, 24 May 2018 04:49:22 +0000 (14:49 +1000)]
test: remove created directories too

If we created it, remove it again. No change because we're not adding any of
the directories yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: make litest_copy_file copy normal files too
Peter Hutterer [Thu, 24 May 2018 04:47:30 +0000 (14:47 +1000)]
test: make litest_copy_file copy normal files too

Make the tempfile creation dependent on whether the required template is
present. Currently unused, this is just prep work for future patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCOPYING: change a cgit to a gitlab URL
Peter Hutterer [Wed, 6 Jun 2018 01:17:54 +0000 (11:17 +1000)]
COPYING: change a cgit to a gitlab URL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: drop the publish-doc tool
Peter Hutterer [Wed, 6 Jun 2018 01:15:38 +0000 (11:15 +1000)]
tools: drop the publish-doc tool

libinput docs must be pushed to wayland's web git repository now

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: Fix URLs for GitLab, HTTPS
Daniel Stone [Tue, 5 Jun 2018 10:07:16 +0000 (11:07 +0100)]
doc: Fix URLs for GitLab, HTTPS

The GitLab migrations means that bugs should now be reported there
rather than Bugzilla. Though the repository is still available via
anongit, cloning through GitLab allows use of HTTPS.

All freedesktop.org URLs are also preferentially served over HTTPS
rather than unsecured HTTP.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agofilter: cap trackpoint scale factor at 1.0
Peter Hutterer [Mon, 4 Jun 2018 03:36:08 +0000 (13:36 +1000)]
filter: cap trackpoint scale factor at 1.0

Otherwise we scale up lower-resolution trackpoints' movements, resulting in a
jumpy cursor.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: the IBM X41 Tablet must not disable the keyboard in tablet mode
Peter Hutterer [Sun, 3 Jun 2018 22:16:48 +0000 (08:16 +1000)]
udev: the IBM X41 Tablet must not disable the keyboard in tablet mode

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.11.0 1.11.0
Peter Hutterer [Mon, 4 Jun 2018 00:16:55 +0000 (10:16 +1000)]
libinput 1.11.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: point at --verbose for libinput debug-events
Peter Hutterer [Sun, 3 Jun 2018 23:21:20 +0000 (09:21 +1000)]
doc: point at --verbose for libinput debug-events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: improve the 'tools' page
Peter Hutterer [Sun, 3 Jun 2018 23:20:15 +0000 (09:20 +1000)]
doc: improve the 'tools' page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "udev: copy the trackpoint sensitivity directly from sysfs"
Peter Hutterer [Fri, 1 Jun 2018 01:19:49 +0000 (11:19 +1000)]
Revert "udev: copy the trackpoint sensitivity directly from sysfs"

The lenovo compact keyboard with trackpoint has a sensitivity of 5, which
causes the trackpoint range to be 0. This in turn causes inf/NaN during
pointer acceleration as we divide by 0 and makes the cursor go unpredictably
somewhere it probably shouldn't be.

This is part of a wider problem in that the current sensitivity handling
doesn't work well for values well below the default of 128. Any such values
are scaled up to multiples of pixels instead of just working as-is.

Reverting the automatic sensitivity parsing, any systemd udev property set to
change the sensitivity increases it, so we don't run into this bug.

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

This reverts commit a4036a33ca6ca8da7d2417cac6b840a89b295e5f.

6 years agoevdev: don't allow a trackpoint range of 0
Peter Hutterer [Fri, 1 Jun 2018 02:47:42 +0000 (12:47 +1000)]
evdev: don't allow a trackpoint range of 0

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: move the "Users" section to the top of the "pages" section
Peter Hutterer [Fri, 1 Jun 2018 03:16:08 +0000 (13:16 +1000)]
doc: move the "Users" section to the top of the "pages" section

On the off-chance that someone actually looks at this page, let's put the
comment most at risk by a TLDR attention span at the top.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the JUMPING_SEMI_MT quirk, no-one uses it
Peter Hutterer [Wed, 30 May 2018 01:14:52 +0000 (11:14 +1000)]
udev: drop the JUMPING_SEMI_MT quirk, no-one uses it

Obsolete since 342bc510164e89d7c9a742406fb98f9deabf5c8f when we disabled MT on
all semi-mt touchpads.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the custom firmware detection code in favor of a modalias
Peter Hutterer [Wed, 30 May 2018 00:50:05 +0000 (10:50 +1000)]
udev: drop the custom firmware detection code in favor of a modalias

This was overengineered. The separation between the model quirks file and the
udev hwdb matches allowed for more complex firmware detection. Except we never
used it anywhere but on ALPS and there we can, thankfully, just get it from
the version number in the input_id field exposed in the modalias.

So let's drop this and use that match instead. We just need an extra udev rule
to match on ID_INPUT_POINTINGSTICKs so we can differ between ALPS touchpads
and ALPS trackpoints.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.902 1.10.902
Peter Hutterer [Mon, 28 May 2018 23:15:10 +0000 (09:15 +1000)]
libinput 1.10.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: replace the hardcoded thumb threshold with a udev prop
Peter Hutterer [Wed, 23 May 2018 23:52:17 +0000 (09:52 +1000)]
touchpad: replace the hardcoded thumb threshold with a udev prop

LIBINPUT_ATTR_THUMB_PRESSURE_THRESHOLD now determines whether we do thumb
pressure detection or not. Much better than having a hardcoded default that
may or may not be correct on any given device.

This patch is likely to break thumb detection on some touchpads, the only
property so far is to restore the default of 100 for all Lenovo Thinkpad
touchpads. More rules are needed, we'll just wait until someone shouts.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRestore the old trackpoint pointer accel picture
Peter Hutterer [Mon, 28 May 2018 03:54:27 +0000 (13:54 +1000)]
Restore the old trackpoint pointer accel picture

Accidentally updated the wrong picture. This reverts part of commit
d6e531349745ff38ae457169d5089ea61297accf.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: update the touchpad pointer acceleration graphs
Peter Hutterer [Mon, 28 May 2018 03:52:10 +0000 (13:52 +1000)]
doc: update the touchpad pointer acceleration graphs

Part of d6e531349745ff38ae457169d5089ea61297accf but I updated the wrong svg
in that commit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: make the dwt paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:46:59 +0000 (11:46 +1000)]
touchpad: make the dwt paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agofallback: make the paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:27:06 +0000 (11:27 +1000)]
fallback: make the paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: increase the proximity timeout during test runs
Peter Hutterer [Mon, 28 May 2018 00:38:12 +0000 (10:38 +1000)]
tablet: increase the proximity timeout during test runs

This is causing too many false positives and they're not easy to filter out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: default to a trackpoint range of 160 for the new ALPS trackpoints
Peter Hutterer [Fri, 25 May 2018 06:37:05 +0000 (16:37 +1000)]
udev: default to a trackpoint range of 160 for the new ALPS trackpoints

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: support firmware detection for pointing sticks
Martin Wilck [Tue, 29 May 2018 07:28:09 +0000 (09:28 +0200)]
udev: support firmware detection for pointing sticks

Add support for firmware detection on pointing stick devices. This
is needed for ALPS only at this time.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: minimum delta measurement
Martin Wilck [Wed, 16 May 2018 14:25:12 +0000 (16:25 +0200)]
libinput-measure-trackpoint-range: minimum delta measurement

libinput-measure-trackpoint-range doesn't work well for ALPS
touchsticks that have minimum delta amplitude of ~8. Fix that
by analyzing min and max amplitude (radius) of the measured deltas,
and suggesting a high trackpoint range value if ALPS-typical behavior
is encountered. Also, suggest a different calibration procedure
to the user; rather then just calibrating quick movements, slow, gentle
movements should also be covered.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: fix typo
Martin Wilck [Wed, 16 May 2018 14:19:10 +0000 (16:19 +0200)]
libinput-measure-trackpoint-range: fix typo

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev prop test for apple touchpads
Peter Hutterer [Fri, 25 May 2018 03:17:34 +0000 (13:17 +1000)]
test: fix udev prop test for apple touchpads

Clearly a copy/paste error.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev rule for the gpio keys test device
Peter Hutterer [Thu, 24 May 2018 02:34:16 +0000 (12:34 +1000)]
test: fix udev rule for the gpio keys test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: fix entry for Lenovo X280, missing dmi: prefix
Peter Hutterer [Thu, 24 May 2018 01:14:00 +0000 (11:14 +1000)]
udev: fix entry for Lenovo X280, missing dmi: prefix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.901 1.10.901
Peter Hutterer [Tue, 22 May 2018 01:13:27 +0000 (11:13 +1000)]
libinput 1.10.901

6 years agoBump TRACKPOINT_DEFAULT_MAX_DELTA to 120
Chow Loong Jin [Thu, 17 May 2018 19:11:57 +0000 (03:11 +0800)]
Bump TRACKPOINT_DEFAULT_MAX_DELTA to 120

This raises the trackpoint speed limit to something more conducive to
long-distance moves.

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

Signed-off-by: Chow Loong Jin <hyperair@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/custom-pointer-accel-revert'
Peter Hutterer [Mon, 21 May 2018 02:19:30 +0000 (12:19 +1000)]
Merge branch 'wip/custom-pointer-accel-revert'