Commit graph

710 commits

Author SHA1 Message Date
Peter Hutterer
f26679c6eb gitlab CI: move the configuration bits into a YAML file
Only one change: the meson boolean to decide whether to build with meson is
now inside the build: block.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-21 09:23:02 +10:00
Peter Hutterer
12211d452a gitlab CI: extend the generation script to be somewhat more generic
Mostly busywork, it moves the hardcoded paths into a variables, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-21 09:23:02 +10:00
Peter Hutterer
fa0a3fc445 gitlab CI: make the "this is generated" warning more obvious
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-21 09:23:02 +10:00
Peter Hutterer
45c223d394 gitlab CI: add a scan-build target
To avoid dnf updates and outdated packages (and the resulting delay from a dnf
update) we just install the clang-analyzer package into the default Fedora
image. It won't mess with the build expectations too much.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-20 17:17:24 +10:00
Peter Hutterer
5a9368f4da gitlab CI: fix a variable substitution
Single quotes means we're not expanding the variable here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-20 17:06:14 +10:00
Peter Hutterer
283dfc07f9 gitlab CI: correct some meson builddirs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-20 17:06:14 +10:00
Peter Hutterer
f7ef246635 meson.build: drop an unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-20 16:26:19 +10:00
Peter Hutterer
03f7b2be46 test: remove unreachable switch case
We only test up to 5 slots, so this cannot ever be reached.

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:33:32 +10:00
Peter Hutterer
4b26eac8ad Fix (theoretical) use of uninitialized variable
This cannot ever be unset on any real device, but coverity is unhappy and
that's not making me happy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:31:48 +10:00
Peter Hutterer
27aaba81d5 Don't try to send BTN_TOOL events for zero fingers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:28:38 +10:00
Peter Hutterer
6ccee710bd Ignore slot sync for slots > 256
Clang doesn't support variable length arrays inside a struct so we could
either make our life complicated or just assume no-one is using more than 256
slots and hard-code that. Let's go for the easy solution until someone
notices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:24:21 +10:00
Peter Hutterer
e9ecb5cabc test: add missing check for tripletap
We don't actually expect to get this one, hence the assert a few lines later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:11:02 +10:00
Peter Hutterer
4c0eddfc74 test: fix a few scan-build errors about dead storage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 13:06:18 +10:00
Peter Hutterer
d6c2b3d0de Update the BTN_TOOL bits correctly during SYN_DROPPED handling
Where at least one touch ends during SYN_DROPPED, we send out two event
frames: one with all applicable touch sequences ending (tracking id -1) and
the second one with the whole device state *and* the applicable touch
sequences starting (tracking id != -1).

This requires us to also update the BTN_TOOL_ bits correctly so that they are
correct after the first frame. For that we count the number of previously
known touches and send a 0 event for the matching BTN_TOOL_ bit, together with
a 1 event for the currently known touches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 11:09:31 +10:00
Peter Hutterer
41de1b0e1a Terminate all stopped/changed touches during SYN_DROPPED in the first frame
The previous event processing had subtle issues with touches stopping during
SYN_DROPPED. All of the device state was processed in the same frame, but if
any touch changed tracking ID during SYN_DROPPED, an inserted SYN_REPORT
resulted in a weird split of events:
- the first frame had all key/sw/abs updates including those slots that
  changed tracking ID, but not the ones that were fully terminated.
- the second frame had only the slots states for newly started touches **and**
  the slot state for touches terminated during SYN_DROPPED but not restarted.

In other words, where three fingers were on the touchpad and slot 0 was lifted
and put down again and slot 1 was lifted but *not* put down again, our frames
contained:
- frame 1: terminate slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1
- frame 2: start slot 0, terminate slot 1

Where there was no touch changing tracking ID, only one frame was generated.
The BTN_TOOL updates were buggy, they may not match the number of fingers down
as seen on a frame-by-frame basis. This triggered libinput bug
https://gitlab.freedesktop.org/libinput/libinput/issues/422

This patch changes the above example to
- frame 1: terminate slot 0, terminate slot 1
- frame 2: start slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1

Notably, the first frame no longer contains the BTN_TOOL bits. This patch is
one of two, the BTN_TOOL sync bits are part of a follow-up patch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 11:06:28 +10:00
Peter Hutterer
2056da9517 Invert an if condition
Go from:
  if (a != b)
     continue;
  foo;

to:
  if (a == b) {
      foo;
  }

Basically just an indentation change after the condition inversion, makes the
follow-up patch easier to review.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 10:37:46 +10:00
Peter Hutterer
507bd1ee28 Push terminating the slots into a helper function
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 10:37:24 +10:00
Peter Hutterer
e38e3ae7c8 Split the MT state syncing and event generation into two functions
In the near future, we will need to handle slot termination *before* any other
state synchronization. So let's start splitting things up.

This is functionally equivalent though dropping the need_tracking_id_changes
variable means we run through all slots now to check if we need to terminate
one of them. Given the normal number of slots on a device and that this should
only ever run very rarely anyway... meh.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 10:35:59 +10:00
Peter Hutterer
b64f94f9c4 Expand the touch state handling during SYN_DROPPED
Keep a better state of each touch before/after the SYN_DROPPED. Most of this
is currently unused, it's functionally the same as before but the new code
serves to increase readability and it can be passed around easier this way.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 10:31:53 +10:00
Peter Hutterer
b2ec3cb7d4 Make the code for handling before/after SYN_DROPPED slot values more readable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 09:05:22 +10:00
Peter Hutterer
ada38025a2 gitlab CI: hook up qemu
This is mostly copied from libinput's qemu setup with a few minor renames.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 08:49:02 +10:00
Peter Hutterer
f795694b2e gitlab CI: replace the hardcoded meson builddir with a variable
Bonus: we test for spaces in the directory name now too

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 08:34:55 +10:00
Peter Hutterer
d7098601c8 meson.build: hook up the static symbols leak test
And because bash on F31 is leaking, we need an extra valgrind suppression.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 08:34:55 +10:00
Peter Hutterer
d654a8edf8 test: change the static symbol leak test to a shell script
Easier to call from meson this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-19 08:34:55 +10:00
Peter Hutterer
cd9fd458a5 test: always ship with the helper files
The tarball shouldn't be dependent on whatever options were passed to
configure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-18 19:39:40 +10:00
Peter Hutterer
ae0effd5ee meson.build: fix some whitespace, put reminder comment in
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-18 19:21:35 +10:00
Peter Hutterer
88701829e7 gitlab CI: add a job to make sure the soname is correct for both build systems
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-18 19:11:40 +10:00
Peter Hutterer
e67826060b gitlab CI: rename the custom build jobs
We don't really care that they're F31, that's an implementation detail. So
let's rename them so we can easily pick which job is which on the pipeline
overview.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-18 19:01:50 +10:00
Peter Hutterer
9fe2dfc8ef gitlab CI: run the test suite through valgrind
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 19:46:23 +10:00
Peter Hutterer
596ebd7acc gitlab CI: add targets to build from each others tarballs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
2f9c40b5fb gitlab CI: add more targets for custom meson builds
Notable: the meson builds don't have a "nm is missing" target because meson
needs it for itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
f2d4ef6cc4 gitlab CI: rename few targets for autotools
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
12f9ec84d9 meson/configure: put a comment in that we don't want to bump the soname
We use symbol versioning anyway, so we don't need to bump the soname every
time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
caf63dca41 gitlab CI: hook up the meson build
Centos doesn't run meson because it's too hard to install the package with dnf
and I can't be bothered going through pip.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
6c88d8c1cf Add support for the meson build system
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
223909ed0b tools: fix the include path for local includes
Make sure we use the local include files, and correct the path accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
d209b66930 gitlab CI: rename the default build jobs to autotools
Prep the path for adding meson

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 14:49:25 +10:00
Peter Hutterer
67b6e447e7 Auto-generate the gitlab CI script
There is so much duplication between the various jobs that it's hard to keep
track of it manually. Let's employ a python script to generate those bits,
reducing the actual gitlab-ci.yml to the hand-written parts only.

The new script takes the .gitlab-ci/gitlab-ci.yml.in and simply appends the
generated parts to it. Most of it is straightforward, only centos needs some
custom parts because of missing doxygen.

The diff is a bit hard to review, thanks to the python script we now group
based on distribution, not based on name (i.e. all fedoras in one group
instead of all container-preps in one group).
And since we're generating anyway, some of the in-between stages were removed
(e.g. $DISTRO-build@template).

A new CI job is added to run a diff against the .gitlab-ci.yml that's checked
in and the one generated by this script. If they differ, we fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 14:23:18 +10:00
Peter Hutterer
3e0a9e084d gitlab CI: move a few sections around
Move the centos builds to after the ubuntu builds and swap the two fedora
builds. Just we have the same order for things here as in the container
prep/clean phases and to make a future patch easier to review.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 11:15:10 +10:00
Peter Hutterer
0dbcfed117 gitlab CI: visually align the container images
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 10:50:30 +10:00
Peter Hutterer
388644b22b Compress an if statement
No functional changes, just making the code slightly more compressed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
50ebda0263 Localize two variables
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
6430694715 Uncomplicate the setting of axis during slot sync
A few bytes get wasted, but no magic handling of offsets etc are required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
c04f5bcec0 Push the tracking id change bits on the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
5501973320 Push the slot_update bits on the stack
Much simpler code this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
757f2d4900 Drop the mt_sync_state in our device struct
Replace it with a stack-allocated one. This saves us a bunch of confusing
allocations and size calculations.

And in the process use uint32_t/int32_t to ensure the struct is actually the
expected size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:43 +00:00
Peter Hutterer
487d80a7fe gitlab CI: align the image tags a bit nicer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 15:55:35 +10:00
Peter Hutterer
c001fe50b0 gitlab CI: rename the default_build to autotools_build
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00
Peter Hutterer
977891bd88 flake8 fixes for make-event-names.py
Mostly whitespace changes, two semicolon removals and one change to "foo is
None".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00
Peter Hutterer
4d4873d101 Change the python script to generate event names to Python3
It's well past time. If you need this to run on python2, patch it out locally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00