platform/upstream/libevdev.git
4 years agomeson.build: use local include path for tests
Peter Seiderer [Mon, 2 Mar 2020 15:16:28 +0000 (16:16 +0100)]
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>
4 years agomeson.build: use local include path for tools
Peter Seiderer [Mon, 2 Mar 2020 15:16:27 +0000 (16:16 +0100)]
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>
4 years agogitlab CI: rebuild images for the new templates
Peter Hutterer [Fri, 13 Mar 2020 03:01:28 +0000 (13:01 +1000)]
gitlab CI: rebuild images for the new templates

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: expand tag lists to 100 per page
Peter Hutterer [Tue, 10 Mar 2020 07:54:10 +0000 (17:54 +1000)]
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>
4 years agogitlab CI: use the ifnot-exists templates from ci-templates
Peter Hutterer [Fri, 6 Mar 2020 05:26:14 +0000 (15:26 +1000)]
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>
4 years agogitlab CI: remove obsolete variable expansion
Peter Hutterer [Fri, 6 Mar 2020 05:08:47 +0000 (15:08 +1000)]
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>
4 years agogitlab CI: Use the new fdo CI templates distribution images
Peter Hutterer [Fri, 6 Mar 2020 04:24:58 +0000 (14:24 +1000)]
gitlab CI: Use the new fdo CI templates distribution images

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: make the container-clean dependent on container-prep
Peter Hutterer [Fri, 28 Feb 2020 03:54:35 +0000 (13:54 +1000)]
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>
4 years agogitlab CI: add static-build meson pipeline
Peter Seiderer [Tue, 10 Mar 2020 11:11:09 +0000 (12:11 +0100)]
gitlab CI: add static-build meson pipeline

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
4 years agomeson.build: enable static library build
Peter Seiderer [Tue, 10 Mar 2020 08:35:52 +0000 (09:35 +0100)]
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>
4 years agogitlab ci: add a helper script for container deletion
Peter Hutterer [Fri, 28 Feb 2020 04:06:10 +0000 (14:06 +1000)]
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>
4 years agogitlab CI: update to the distribution-independent CI-templates
Peter Hutterer [Sun, 23 Feb 2020 22:12:35 +0000 (08:12 +1000)]
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>
4 years agogitlab CI: group the config by distribution type
Peter Hutterer [Thu, 27 Feb 2020 05:56:29 +0000 (15:56 +1000)]
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>
4 years agogitlab CI: expire the results.xml artifacts
Peter Hutterer [Thu, 27 Feb 2020 23:33:45 +0000 (09:33 +1000)]
gitlab CI: expire the results.xml artifacts

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoREADME: note that patches go as MRs to gitlab now
Peter Hutterer [Thu, 5 Mar 2020 21:28:48 +0000 (07:28 +1000)]
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>
4 years agolibevdev 1.9.0 libevdev-1.9.0
Peter Hutterer [Mon, 2 Mar 2020 03:48:25 +0000 (13:48 +1000)]
libevdev 1.9.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: keep the results of the check-commit job as artifact
Peter Hutterer [Fri, 28 Feb 2020 03:36:17 +0000 (13:36 +1000)]
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>
4 years agoUse editorconfig instead of a sprinkling of :vim: instructions
Peter Hutterer [Tue, 25 Feb 2020 23:33:18 +0000 (09:33 +1000)]
Use editorconfig instead of a sprinkling of :vim: instructions

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: drop the distribution "flavor" in favor of just the name
Peter Hutterer [Wed, 26 Feb 2020 03:04:42 +0000 (13:04 +1000)]
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>
4 years agogitlab CI: move the container-clean git strategy to the parent section
Peter Hutterer [Wed, 26 Feb 2020 03:07:09 +0000 (13:07 +1000)]
gitlab CI: move the container-clean git strategy to the parent section

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: don't allow failures on the kvm jobs
Peter Hutterer [Wed, 26 Feb 2020 01:37:46 +0000 (11:37 +1000)]
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>
4 years agogitlab CI: update to the latest ci-templates again
Peter Hutterer [Sun, 23 Feb 2020 22:12:35 +0000 (08:12 +1000)]
gitlab CI: update to the latest ci-templates again

Unclear what happend but I suspect a rebase went wrong so
e03cdd1d3ff3731eb1432501c48b742e2c6e34ca didn't actually update to the new
ci-templates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: prefill the junit conversion script from the gitlab environment
Peter Hutterer [Mon, 24 Feb 2020 04:57:52 +0000 (14:57 +1000)]
gitlab CI: prefill the junit conversion script from the gitlab environment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: re-use the meson-build.sh script for normal meson jobs
Peter Hutterer [Mon, 24 Feb 2020 01:29:42 +0000 (11:29 +1000)]
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>
4 years agogitlab CI: hook up junit test reports to the meson results
Peter Hutterer [Sun, 23 Feb 2020 23:37:36 +0000 (09:37 +1000)]
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>
4 years agogitlab CI: update to latest ci-templates
Peter Hutterer [Sun, 23 Feb 2020 22:12:35 +0000 (08:12 +1000)]
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>
4 years agogitlab CI: generate the template list from the config data
Peter Hutterer [Sun, 23 Feb 2020 22:21:55 +0000 (08:21 +1000)]
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>
4 years agogitlab CI: set the vim filetype for the template file
Peter Hutterer [Sun, 23 Feb 2020 22:24:21 +0000 (08:24 +1000)]
gitlab CI: set the vim filetype for the template file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agolibevdev 1.9rc1 libevdev-1.8.901
Peter Hutterer [Fri, 21 Feb 2020 00:47:53 +0000 (10:47 +1000)]
libevdev 1.9rc1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: move the configuration bits into a YAML file
Peter Hutterer [Thu, 20 Feb 2020 23:05:04 +0000 (09:05 +1000)]
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>
4 years agogitlab CI: extend the generation script to be somewhat more generic
Peter Hutterer [Thu, 20 Feb 2020 23:03:59 +0000 (09:03 +1000)]
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>
4 years agogitlab CI: make the "this is generated" warning more obvious
Peter Hutterer [Thu, 20 Feb 2020 23:13:00 +0000 (09:13 +1000)]
gitlab CI: make the "this is generated" warning more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: add a scan-build target
Peter Hutterer [Thu, 20 Feb 2020 06:33:05 +0000 (16:33 +1000)]
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>
4 years agogitlab CI: fix a variable substitution
Peter Hutterer [Thu, 20 Feb 2020 06:59:54 +0000 (16:59 +1000)]
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>
4 years agogitlab CI: correct some meson builddirs
Peter Hutterer [Thu, 20 Feb 2020 06:35:37 +0000 (16:35 +1000)]
gitlab CI: correct some meson builddirs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agomeson.build: drop an unused variable
Peter Hutterer [Thu, 20 Feb 2020 06:26:19 +0000 (16:26 +1000)]
meson.build: drop an unused variable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: remove unreachable switch case
Peter Hutterer [Wed, 19 Feb 2020 03:33:32 +0000 (13:33 +1000)]
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>
4 years agoFix (theoretical) use of uninitialized variable
Peter Hutterer [Wed, 19 Feb 2020 03:31:48 +0000 (13:31 +1000)]
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>
4 years agoDon't try to send BTN_TOOL events for zero fingers
Peter Hutterer [Wed, 19 Feb 2020 03:28:38 +0000 (13:28 +1000)]
Don't try to send BTN_TOOL events for zero fingers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoIgnore slot sync for slots > 256
Peter Hutterer [Wed, 19 Feb 2020 03:18:48 +0000 (13:18 +1000)]
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>
4 years agotest: add missing check for tripletap
Peter Hutterer [Wed, 19 Feb 2020 03:08:32 +0000 (13:08 +1000)]
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>
4 years agotest: fix a few scan-build errors about dead storage
Peter Hutterer [Wed, 19 Feb 2020 03:06:18 +0000 (13:06 +1000)]
test: fix a few scan-build errors about dead storage

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoUpdate the BTN_TOOL bits correctly during SYN_DROPPED handling
Peter Hutterer [Thu, 13 Feb 2020 11:35:51 +0000 (21:35 +1000)]
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>
4 years agoTerminate all stopped/changed touches during SYN_DROPPED in the first frame
Peter Hutterer [Thu, 13 Feb 2020 11:11:14 +0000 (21:11 +1000)]
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>
4 years agoInvert an if condition
Peter Hutterer [Thu, 13 Feb 2020 11:09:24 +0000 (21:09 +1000)]
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>
4 years agoPush terminating the slots into a helper function
Peter Hutterer [Thu, 13 Feb 2020 10:39:41 +0000 (20:39 +1000)]
Push terminating the slots into a helper function

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoSplit the MT state syncing and event generation into two functions
Peter Hutterer [Thu, 13 Feb 2020 08:14:50 +0000 (18:14 +1000)]
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>
4 years agoExpand the touch state handling during SYN_DROPPED
Peter Hutterer [Thu, 13 Feb 2020 06:50:17 +0000 (16:50 +1000)]
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>
4 years agoMake the code for handling before/after SYN_DROPPED slot values more readable
Peter Hutterer [Thu, 13 Feb 2020 06:39:20 +0000 (16:39 +1000)]
Make the code for handling before/after SYN_DROPPED slot values more readable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: hook up qemu
Peter Hutterer [Tue, 18 Feb 2020 10:22:12 +0000 (20:22 +1000)]
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>
4 years agogitlab CI: replace the hardcoded meson builddir with a variable
Peter Hutterer [Tue, 18 Feb 2020 10:31:32 +0000 (20:31 +1000)]
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>
4 years agomeson.build: hook up the static symbols leak test
Peter Hutterer [Tue, 18 Feb 2020 09:31:43 +0000 (19:31 +1000)]
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>
4 years agotest: change the static symbol leak test to a shell script
Peter Hutterer [Tue, 18 Feb 2020 09:21:47 +0000 (19:21 +1000)]
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>
4 years agotest: always ship with the helper files
Peter Hutterer [Tue, 18 Feb 2020 09:39:01 +0000 (19:39 +1000)]
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>
4 years agomeson.build: fix some whitespace, put reminder comment in
Peter Hutterer [Tue, 18 Feb 2020 09:17:50 +0000 (19:17 +1000)]
meson.build: fix some whitespace, put reminder comment in

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: add a job to make sure the soname is correct for both build systems
Peter Hutterer [Tue, 18 Feb 2020 09:00:44 +0000 (19:00 +1000)]
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>
4 years agogitlab CI: rename the custom build jobs
Peter Hutterer [Tue, 18 Feb 2020 08:47:07 +0000 (18:47 +1000)]
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>
4 years agogitlab CI: run the test suite through valgrind
Peter Hutterer [Mon, 17 Feb 2020 09:24:29 +0000 (19:24 +1000)]
gitlab CI: run the test suite through valgrind

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: add targets to build from each others tarballs
Peter Hutterer [Mon, 17 Feb 2020 07:08:48 +0000 (17:08 +1000)]
gitlab CI: add targets to build from each others tarballs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: add more targets for custom meson builds
Peter Hutterer [Mon, 17 Feb 2020 06:58:22 +0000 (16:58 +1000)]
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>
4 years agogitlab CI: rename few targets for autotools
Peter Hutterer [Mon, 17 Feb 2020 06:54:52 +0000 (16:54 +1000)]
gitlab CI: rename few targets for autotools

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agomeson/configure: put a comment in that we don't want to bump the soname
Peter Hutterer [Mon, 17 Feb 2020 06:49:35 +0000 (16:49 +1000)]
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>
4 years agogitlab CI: hook up the meson build
Peter Hutterer [Fri, 14 Feb 2020 02:06:46 +0000 (12:06 +1000)]
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>
4 years agoAdd support for the meson build system
Peter Hutterer [Mon, 26 Aug 2019 06:50:34 +0000 (16:50 +1000)]
Add support for the meson build system

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotools: fix the include path for local includes
Peter Hutterer [Mon, 17 Feb 2020 07:40:57 +0000 (17:40 +1000)]
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>
4 years agogitlab CI: rename the default build jobs to autotools
Peter Hutterer [Mon, 17 Feb 2020 04:43:15 +0000 (14:43 +1000)]
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>
4 years agoAuto-generate the gitlab CI script
Peter Hutterer [Fri, 14 Feb 2020 04:40:12 +0000 (14:40 +1000)]
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>
4 years agogitlab CI: move a few sections around
Peter Hutterer [Mon, 17 Feb 2020 00:53:32 +0000 (10:53 +1000)]
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>
4 years agogitlab CI: visually align the container images
Peter Hutterer [Mon, 17 Feb 2020 00:49:20 +0000 (10:49 +1000)]
gitlab CI: visually align the container images

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoCompress an if statement
Peter Hutterer [Wed, 12 Feb 2020 22:28:59 +0000 (08:28 +1000)]
Compress an if statement

No functional changes, just making the code slightly more compressed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoLocalize two variables
Peter Hutterer [Wed, 12 Feb 2020 22:28:32 +0000 (08:28 +1000)]
Localize two variables

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoUncomplicate the setting of axis during slot sync
Peter Hutterer [Wed, 12 Feb 2020 12:17:13 +0000 (22:17 +1000)]
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>
4 years agoPush the tracking id change bits on the stack
Peter Hutterer [Wed, 12 Feb 2020 12:10:59 +0000 (22:10 +1000)]
Push the tracking id change bits on the stack

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoPush the slot_update bits on the stack
Peter Hutterer [Wed, 12 Feb 2020 12:09:36 +0000 (22:09 +1000)]
Push the slot_update bits on the stack

Much simpler code this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoDrop the mt_sync_state in our device struct
Peter Hutterer [Wed, 12 Feb 2020 12:05:33 +0000 (22:05 +1000)]
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>
4 years agogitlab CI: align the image tags a bit nicer
Peter Hutterer [Fri, 14 Feb 2020 04:41:32 +0000 (14:41 +1000)]
gitlab CI: align the image tags a bit nicer

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: rename the default_build to autotools_build
Peter Hutterer [Fri, 14 Feb 2020 02:20:55 +0000 (12:20 +1000)]
gitlab CI: rename the default_build to autotools_build

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoflake8 fixes for make-event-names.py
Peter Hutterer [Fri, 14 Feb 2020 02:49:27 +0000 (12:49 +1000)]
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>
4 years agoChange the python script to generate event names to Python3
Peter Hutterer [Fri, 14 Feb 2020 02:46:56 +0000 (12:46 +1000)]
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>
4 years agotest: silence warnings about missing field initializers
Peter Hutterer [Fri, 14 Feb 2020 00:38:32 +0000 (10:38 +1000)]
test: silence warnings about missing field initializers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: fix two signed vs unsigned warnings
Peter Hutterer [Fri, 14 Feb 2020 00:28:24 +0000 (10:28 +1000)]
test: fix two signed vs unsigned warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agouinput: drop an unused function argument
Peter Hutterer [Fri, 14 Feb 2020 00:20:07 +0000 (10:20 +1000)]
uinput: drop an unused function argument

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotools: drop explicit GNU_SOURCE define
Peter Hutterer [Fri, 14 Feb 2020 00:13:52 +0000 (10:13 +1000)]
tools: drop explicit GNU_SOURCE define

It's defined globally through AC_USE_SYSTEM_EXTENSIONS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoconfig.h is a local include path
Peter Hutterer [Fri, 14 Feb 2020 00:13:18 +0000 (10:13 +1000)]
config.h is a local include path

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotools: drop use of HAVE_CONFIG_H
Peter Hutterer [Fri, 14 Feb 2020 00:11:32 +0000 (10:11 +1000)]
tools: drop use of HAVE_CONFIG_H

There's no case where we don't have a config.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: separate builddir from srcdir
Peter Hutterer [Fri, 14 Feb 2020 01:43:19 +0000 (11:43 +1000)]
gitlab CI: separate builddir from srcdir

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: use extends over yaml anchors
Peter Hutterer [Thu, 13 Feb 2020 22:40:16 +0000 (08:40 +1000)]
gitlab CI: use extends over yaml anchors

This also gets rid of some superfluous inclusions - all those are inherited
now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: remove a reference to libinput
Peter Hutterer [Thu, 13 Feb 2020 22:38:32 +0000 (08:38 +1000)]
gitlab CI: remove a reference to libinput

That's what you get for copy/paste...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agogitlab CI: add a check-commit stage
Peter Hutterer [Thu, 13 Feb 2020 22:20:27 +0000 (08:20 +1000)]
gitlab CI: add a check-commit stage

Taken from libinput, checks for signed-off-by and other things.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoconfigure.ac: add a toggle to enable the special coverity options
Peter Hutterer [Wed, 12 Feb 2020 22:06:33 +0000 (08:06 +1000)]
configure.ac: add a toggle to enable the special coverity options

Coverity tries to supply system headers and fails badly at it. A bunch of
_Float... sizes are pulled in by math.h but not provided anywhere. So as a
workaround, let's add an option to explicitly enable coverity support that
simply #defines those types to ones we do know about and let's go on hoping
it'll eventually work.

See the equivalent addition to libinput in commit 8178339b5baa717.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoAdd queue_push_event as shortcut for the two-liner we use everywhere
Peter Hutterer [Tue, 11 Feb 2020 03:51:17 +0000 (13:51 +1000)]
Add queue_push_event as shortcut for the two-liner we use everywhere

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoSimplify some error handling by assuming a >=3.4 kernel
Peter Hutterer [Tue, 11 Feb 2020 03:23:44 +0000 (13:23 +1000)]
Simplify some error handling by assuming a >=3.4 kernel

v3.4 was released in 2012, every kernel since has that ioctl. So instead of
assuming you're running new libevdev on an 8 year old kernel, let's assume
that any error from the ioctl() is an actual error and handle it accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: slightly modernize some of the tests
Peter Hutterer [Tue, 11 Feb 2020 09:46:59 +0000 (19:46 +1000)]
test: slightly modernize some of the tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: provide a function to print an event
Peter Hutterer [Tue, 11 Feb 2020 10:44:25 +0000 (20:44 +1000)]
test: provide a function to print an event

Easy to copy/paste into a test that needs a bit of debugging, otherwise unused.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: split the tests into one test case each
Peter Hutterer [Tue, 11 Feb 2020 10:37:01 +0000 (20:37 +1000)]
test: split the tests into one test case each

For debugging it's more important to be able to quickly run a single test
rather than grouping them together, we don't have thousands of tests here
anyway. So let's add a macro to put every test func into its own TCase,
allowing for test selection via the environment variable CK_RUN_CASE.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agotest: wrap the event checks into a macro
Peter Hutterer [Mon, 10 Feb 2020 09:10:05 +0000 (19:10 +1000)]
test: wrap the event checks into a macro

One-liner to check an event rather than three separate statements in every
test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agodoc: add markdown for monospace rendering of defines
Peter Hutterer [Mon, 10 Feb 2020 09:46:07 +0000 (19:46 +1000)]
doc: add markdown for monospace rendering of defines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
4 years agoOnly use GCC pragma on GCC
Michael Forney [Mon, 17 Jun 2019 00:18:00 +0000 (17:18 -0700)]
Only use GCC pragma on GCC

Signed-off-by: Michael Forney <mforney@mforney.org>
4 years agoAvoid initializer index range
Michael Forney [Mon, 17 Jun 2019 00:14:18 +0000 (17:14 -0700)]
Avoid initializer index range

This is a GNU C extension, and is not available in ISO C.

Instead, just explicitly initialize other indices to -1.

Signed-off-by: Michael Forney <mforney@mforney.org>
4 years agoAdd fallback min/max for compilers that don't have statement expressions
Michael Forney [Mon, 17 Jun 2019 00:05:30 +0000 (17:05 -0700)]
Add fallback min/max for compilers that don't have statement expressions

Statement expressions are a GNU C extension and are not available
in ISO C.

On compilers that don't have them, define these macros as plain
conditional expressions, since they are only ever used with expressions
that have no side-effects.

The statement-expression version is still retained as an added
safety measure on GNU-compatible compilers.

Signed-off-by: Michael Forney <mforney@mforney.org>