Commit graph

3221 commits

Author SHA1 Message Date
Peter Hutterer
91e6a84f2c tools: list-quirks: add the thumb pressure threshold property
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
201c876ab4 tools: list-quirks: fix usage to read "libinput list-quirks"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
e855605616 tools: list-quirks: compress a condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
c9cc785612 quirks: drop the JUMPING_SEMI_MT model
Removed from the udev properties in a55693f87c
but survived here while the branch was in process.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
307f4a5636 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>
2018-06-20 11:41:48 +10:00
Peter Hutterer
793c8d51e8 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>
2018-06-20 11:41:48 +10:00
Peter Hutterer
4203ab52bf 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>
2018-06-20 11:26:57 +10:00
Peter Hutterer
1605f71a0b 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>
2018-06-20 11:26:57 +10:00
Peter Hutterer
7c51c881dc 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 0a13223c39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:26:57 +10:00
Benjamin Tissoires
e70e67847c 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>
2018-06-19 10:41:48 +02:00
Benjamin Tissoires
b2b7fab7b1 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>
2018-06-19 10:41:43 +02:00
Benjamin Tissoires
ca60c67bc1 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>
2018-06-19 10:41:16 +02:00
Peter Hutterer
30b9c929a6 doc: point to the gitlab ci file for a list of required packages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-19 13:40:07 +10:00
Peter Hutterer
4de756766c 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>
2018-06-19 13:13:24 +10:00
Peter Hutterer
17c4609645 quirks: add more assertion to avoid API misusage (v2)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-19 13:07:24 +10:00
Peter Hutterer
14b7bb4726 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 2c4f963b18.
2018-06-18 20:55:27 +10:00
Peter Hutterer
7266ed600a test: pass the open mode to open(O_CREAT)
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 13:41:18 +10:00
Peter Hutterer
2c4f963b18 quirks: add more assertion to avoid API misusage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 13:35:34 +10:00
Peter Hutterer
8aef361062 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>
2018-06-18 13:29:23 +10:00
Peter Hutterer
653beca662 quirk: remove unused variable
Also fixes a coverity complaint about incrementing an uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 13:25:02 +10:00
Peter Hutterer
334b625300 gitlab ci: use GIT_DEPTH of 1
We don't need the full repo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 12:35:42 +10:00
Peter Hutterer
870ddce9e4 Drop the udev hwdb model quirks
Replaced with the quirks files in merge commit
000ac14c27

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 11:04:43 +10:00
Peter Hutterer
a7d19e44db 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>
2018-06-18 11:00:23 +10:00
Peter Hutterer
2dfe27af25 Merge branch 'wip/quirks-fixes' 2018-06-18 10:55:27 +10:00
Peter Hutterer
d3cb40e914 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>
2018-06-18 10:34:25 +10:00
Peter Hutterer
b20f6c2330 data: add the alps firmware version LUT
Just in case we need it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 10:34:25 +10:00
Peter Hutterer
0bb30e5d3e data: put a 'do not edit' warning into all data files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 10:34:25 +10:00
Peter Hutterer
d3633aac24 data: add ALPS v8 trackpoint range
Got lost in the hwdb to quirks conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 10:34:25 +10:00
Peter Hutterer
21ece0ce79 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>
2018-06-18 10:34:25 +10:00
Peter Hutterer
31e349fb5b 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>
2018-06-18 10:34:25 +10:00
Peter Hutterer
a57d35a1aa 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>
2018-06-18 10:34:16 +10:00
Peter Hutterer
cb7c9e596f 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>
2018-06-18 10:33:01 +10:00
Benjamin Tissoires
8f3a8a5302 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>
2018-06-18 00:24:45 +00:00
Peter Hutterer
a5700dcf43 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>
2018-06-18 08:52:21 +10:00
Konstantin Kharlamov
734496d972 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>
2018-06-15 10:10:13 +10:00
Peter Hutterer
0d6dea5d8f 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>
2018-06-15 08:01:53 +10:00
Peter Hutterer
20ccb81726 test: fix a test device section name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 15:54:02 +10:00
Peter Hutterer
1ab2ef40ea test: fix the input_id struct for the ALPS touchpad
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 15:22:38 +10:00
Peter Hutterer
d4a91c0a00 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>
2018-06-14 15:07:15 +10:00
Peter Hutterer
465c3eaf99 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>
2018-06-14 10:05:10 +10:00
Peter Hutterer
0a13223c39 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>
2018-06-14 09:50:29 +10:00
Peter Hutterer
50ca923c5f Move CODING_STYLE to markdown
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 08:45:56 +10:00
Konstantin Kharlamov
a23414dd1f touchpad: replace last_point with history.samples
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2018-06-14 08:31:30 +10:00
Peter Hutterer
da3e4ccb6b meson.build: bump to 1.11.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-13 15:45:27 +10:00
Peter Hutterer
c8084a7d58 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>
2018-06-13 15:22:24 +10:00
Peter Hutterer
000ac14c27 Merge branch 'wip/config-files' 2018-06-11 13:45:50 +10:00
Peter Hutterer
b4ff592a5a tools: libinput-record: put extra guard in to protect from OOB access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-11 13:43:40 +10:00
Peter Hutterer
8865d4a29d 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>
2018-06-11 13:43:40 +10:00
Peter Hutterer
24a19dd167 util: put limits on how many strings we join
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-11 13:43:37 +10:00
Peter Hutterer
6ad928a1b6 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>
2018-06-11 13:43:15 +10:00