Commit graph

839 commits

Author SHA1 Message Date
Peter Seiderer
103f3870f0 meson.build: use local include path for tests
Fixes:

  ../test/test-common.h: In function ‘print_event’:
  ../test/test-common.h:97:6: error: ‘const struct input_event’ has no member named ‘input_event_sec’
      ev->input_event_sec,
        ^
  ../test/test-common.h:98:6: error: ‘const struct input_event’ has no member named ‘input_event_usec’
      ev->input_event_usec,
        ^
  ../test/test-common.h:102:6: error: ‘const struct input_event’ has no member named ‘input_event_sec’
      ev->input_event_sec,
        ^
  ../test/test-common.h:103:6: error: ‘const struct input_event’ has no member named ‘input_event_usec’
      ev->input_event_usec,
        ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 04:01:20 +00:00
Peter Seiderer
fe8238a71a meson.build: use local include path for tools
Fixes the following compile failure with old toolchains and meson
build (autotools build not affected):

  ../tools/mouse-dpi-tool.c: In function ‘handle_event’:
  ../tools/mouse-dpi-tool.c:115:13: error: ‘const struct input_event’ has no member named ‘input_event_sec’
     m->us = ev->input_event_sec * 1000000 + ev->input_event_usec;
               ^
  ../tools/mouse-dpi-tool.c:115:45: error: ‘const struct input_event’ has no member named ‘input_event_usec’
     m->us = ev->input_event_sec * 1000000 + ev->input_event_usec;
                                               ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 04:01:20 +00:00
Peter Hutterer
a1fe50635e gitlab CI: rebuild images for the new templates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 13:01:28 +10:00
Peter Hutterer
68cdac7420 gitlab CI: expand tag lists to 100 per page
Lets make sure we can delete more than 20 tags at a time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 12:47:55 +10:00
Peter Hutterer
fc501b78ba gitlab CI: use the ifnot-exists templates from ci-templates
Let's not duplicate the functionality, use the upstream templates because
they'll actually see improvements over time.

Define two jobs, one that is the ifnot-exists job and one that is the normal
container-build job. The second one only runs on schedules.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 12:47:55 +10:00
Peter Hutterer
7d2b4b5ffe gitlab CI: remove obsolete variable expansion
gitlab doesn't support double-nested variables so we can assume that these
variables don't need further expansion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 12:47:55 +10:00
Peter Hutterer
bd8225286a gitlab CI: Use the new fdo CI templates distribution images
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 12:46:54 +10:00
Peter Hutterer
1b1b446597 gitlab CI: make the container-clean dependent on container-prep
This is a test commit only to speed things up when testing the container-clean
phase. In the real instance, we don't want to remove our containers until the
test suite successfully completes on the new container.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 12:44:22 +10:00
Peter Seiderer
18ef5f76e0 gitlab CI: add static-build meson pipeline
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2020-03-11 07:46:59 +01:00
Peter Seiderer
a9d324f82b meson.build: enable static library build
Use meson library() instead of shared_library() to enable
static build.

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2020-03-10 09:51:27 +01:00
Peter Hutterer
da5bfe22d2 gitlab ci: add a helper script for container deletion
Rather than raw curl requests to the API, use a python script using the gitlab
python package to access everything. This makes things a bit more readable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-09 08:52:02 +10:00
Peter Hutterer
6441b639aa gitlab CI: update to the distribution-independent CI-templates
These templates get rid of the various distribution-specific naming and
instead default to the namespaced FDO_DISTRIBUTION_<foo> for whatever value we
need. So FEDORA_RPMS, DEBIAN_DEBS etc. becomes FDO_DISTRIBUTION_PACKAGES for
example.

By necessity this is one large commit. gitlab does not allow nested variable
expansion, so the previous approach of global variables didn't work.
Specifically, we'd end up with a template in this form:

variables:
  FEDORA_TAG: 12345

.base_template:
  variables:
     DISTRO_IMAGE: $DISTRO_TAG

.fedora:
  variables:
     $DISTRO_TAG: $FEDORA_TAG

But the actual DISTRO_IMAGE variable would be the literal string $FEDORA_TAG,
not the value of that variable. So all of it needed to be reworked.

Specifically:
- the packages to install moved to the config yaml file
- the distribution tag is now in the config yaml file
- all distributions now share the same tag (because lazyness)
- there are .fedora:30, .debian:stable, etc. templates now with the variables
  defined as needed, jobs will extends those templates as they need those
  distributions
- qemu-prep jobs are now generated too (based on the config yaml file)

Overall, it ends up cleaner despite the mess in this patch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-09 08:51:59 +10:00
Peter Hutterer
bf72012921 gitlab CI: group the config by distribution type
No functional changes, this produces the same gitlab CI file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-06 13:32:01 +10:00
Peter Hutterer
59a9c6c5fb gitlab CI: expire the results.xml artifacts
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-06 13:32:01 +10:00
Peter Hutterer
fcaa579bd0 README: note that patches go as MRs to gitlab now
Make the GitLab spelling consistent too and remove the git protocol link, it
looks awkward in the rendering and you can get all that from the gitlab repo
anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-06 07:44:08 +10:00
Peter Hutterer
468760ba11 libevdev 1.9.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-02 14:11:43 +10:00
Peter Hutterer
edb5b92f89 gitlab CI: keep the results of the check-commit job as artifact
Due to how pytest is used, we don't get the actual errors printed in the
commandline log if this job fails. This doesn't matter in merge requests where
the results are displayed nicely but where there's no merge request we can't
get this info out at all. So let's simply store the xml file for an easy
check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-02 14:11:43 +10:00
Peter Hutterer
13775b56e5 Use editorconfig instead of a sprinkling of :vim: instructions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-27 05:58:05 +00:00
Peter Hutterer
cda3dc664a gitlab CI: drop the distribution "flavor" in favor of just the name
This is a leftover from ci-templates where the name of a distribution didn't
necessarily match the image (arch vs archlinux) and is no longer needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-26 13:13:19 +10:00
Peter Hutterer
c12af0864c gitlab CI: move the container-clean git strategy to the parent section
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-26 13:13:16 +10:00
Peter Hutterer
2a51c15683 gitlab CI: don't allow failures on the kvm jobs
This is a leftover from libinput where we have to allow failures because of
frequent issues with timing. We don't have these issues here so a failed job
in the VM indicates a bug.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-26 11:37:46 +10:00
Peter Hutterer
805421582f gitlab CI: update to the latest ci-templates again
Unclear what happend but I suspect a rebase went wrong so
e03cdd1d3f didn't actually update to the new
ci-templates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-25 17:03:21 +10:00
Peter Hutterer
134b889724 gitlab CI: prefill the junit conversion script from the gitlab environment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 15:33:00 +10:00
Peter Hutterer
82538647c1 gitlab CI: re-use the meson-build.sh script for normal meson jobs
Let's invoke the same meson steps for every build task.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 14:23:21 +10:00
Peter Hutterer
15e0b024df gitlab CI: hook up junit test reports to the meson results
The KVM tests use this for now, not the container builds where we run meson
directly.

The python script to convert meson test logs to junit results expects suite
names, so let's add all tests to suites so we don't need to carry local
modifications.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 11:52:14 +10:00
Peter Hutterer
e03cdd1d3f gitlab CI: update to latest ci-templates
This gives us a warning where qemu failed to start and it gets rid of the
different "flavor" that only archlinux had different to the distribution name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 08:44:48 +10:00
Peter Hutterer
0e665a2780 gitlab CI: generate the template list from the config data
Only change in the actual gitlab CI file is that the sorting is now
alphabetical.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 08:44:48 +10:00
Peter Hutterer
db602d0d06 gitlab CI: set the vim filetype for the template file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 08:44:48 +10:00
Peter Hutterer
2038781bc2 libevdev 1.9rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-21 10:47:53 +10:00
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