Commit graph

879 commits

Author SHA1 Message Date
Peter Hutterer
f6c0a048c5 tools: add a man page for the touchpad-edge-detector tool
Requires some .gitignore pattern removal too and an autotools fix to actually
dist the man pages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 09:56:33 +10:00
Peter Hutterer
da2eea1dcb meson.build: install the libevdev-tweak-device man page
This got lost in meson conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 09:44:45 +10:00
Niclas Zeising
6ea230bc72 tools: Remove signalfd.h include again
Remove the includsion of sys/signalfd.h again, it hasn't been needed
since cca90938 and was accidentally re-added, probably as a mismerge,
in a40e014e.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-09-19 12:13:12 +02:00
Peter Hutterer
44b5c9bd9f include: sync event codes with kernel 5.8
And fix the script to sync the headers up so it syncs event codes for both bsd
and linux, but only syncs input.h for linux.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 12:13:13 +10:00
Peter Hutterer
b40675c701 doc: fix doxyen complaints after fd6c9b8ca0
Fixes fd6c9b8ca0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 12:13:04 +10:00
Peter Hutterer
cb5d56ab80 gitlab ci: run the qemu jobs on F32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 11:04:27 +10:00
Peter Hutterer
ed71864c4c gitlab CI: update to use F32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 10:38:54 +10:00
Rosen Penev
fb6a84a52a
[clang-tidy] do not use else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 00:42:20 -07:00
Rosen Penev
a40e014eca
libevdev: sort includes alphabetically
Found with clang-tidy's llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 00:29:54 -07:00
Rosen Penev
cd8bde522f libevdev: remove pointless return in void function
Found with clang-tidy's readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 07:15:28 +00:00
Rosen Penev
fd6c9b8ca0 libevdev: fix inconsistent declarations
Found with clang-tidy's readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 07:15:28 +00:00
Niclas Zeising
1f54f82f70 Document FreeBSD quirks
Document FreeBSD quirks related to syspath.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
4194023122 tests: Add FreeBSD specific tests
Add two FreeBSD specific tests:
test_uinput_check_devnode_bsd checks that libevdev_uinput_get_devnode()
returns something sensible.  This is modelled on the Linux test
test_uinput_check_syspath_name, but uses devnode instead of syspath, since
reeBSD doesn't have sysfs.
test_uinput_check_syspath_bsd checks that libevdev_uinput_get_syspath()
always returns NULL.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
0af8c4054d tests: Disable attach debugger on FreeBSD
Disable attaching a debugger on FreeBSD, since FreeBSD lacks support for
PTRACE_ATTACH.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
8026722f86 tests: disable force feedback events on FreeBSD
FreeBSD does not support force feedack events.  Disable the test for
this event when running on FreeBSD.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
800946a673 tests: Use CLOCK_MONOTONIC_FAST on FreeBSD
FreeBSD does not have CLOCK_MONOTONIC_RAW, instead use
CLOCK_MONOTONIC_FAST.  This test checks that libevdev_set_clock_id()
fails when called with CLOCK_MONOTONIC_[RAW,FAST].

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
83e446225d uinput: Implement FreeBSD fetch_syspath_and_devnode()
Implement a FreeBSD version of fetch_syspath_and_devnode().
FreeBSD does not have sysfs, so instead fetch the device node directly
as as this matches with what is returned by the UI_GET_SYSNAME ioctl().
Since there is no sysfs, libevdev_uinput.syspath will always be set to NULL.

If the ioctl fail, return -1 from fetch_syspath_and_devnode(), since
there is no other way to figure out the device node path.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
153d8d0a5a uinput: Move SYS_INPUT_DIR to where it is used
Move the definition of SYS_INPUT_DIR to where it is used, instead of at
the top of the file, to make it easier to find.
Undefine it at the end of usage to avoid accidental uses.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
1bf2b41d3f tools: use basename(argv[0]) for program name
Use baename(argv[0]) to get the program name (for usage), instead of
using program_invocation_short_name, which only exists on Linux, not
FreeBSD.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
cca9093887 tools: Remove signalfd() use
Remove signalfd() use from the mouse-dpi-tool and touchpad-edge-detector
tools, in favor of using plain old signals.
FreeBSD does not have signalfd() without pulling in external libraries,
and with this change these tools can be compiled on FreeBSD.
Instead of providing two implementations, one using signalfd() and one
using signal(), just use the signal() implementation everywhere as it is
more portable.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
7ce82709aa Add FreeBSD compatible input.h and uinput.h
Add FreeBSD compatible input.h and uinput.h files.
This is done by moving the linux files to include/linux/linux, adding
the freebsd versions in include/linux/freebsd, and then changing
include/linux/[u]input.h to pull in the right one depending on which OS
we are compiling on.
Make sure that the build infrastructure in meson.build and
autoconf.ac/Makefile.am uses the correct files when building and as
dependency for targets, and ensure that make-event-names.py get the
correct files as arguments.

A similar change has been done in libinput in
61f3e3854458c556a01fb05d7abb22733fd2b7c1

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
db01b2d606 Don't hardcode /bin/bash
Don't hardcode /bin/bash, use /usr/bin/env bash instead, since not all
platforms install bash as /bin/bash.
FreeBSD, as an example, installs bash in /usr/local/bin/bash by default.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-13 13:11:33 +02:00
Peter Hutterer
bcb79eed39 libevdev 1.9.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-16 13:39:45 +10:00
Peter Hutterer
66113fe84f libevdev: any value less than 0 has a NULL name
Fixes https://gitlab.freedesktop.org/libevdev/libevdev/-/issues/15

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-15 13:36:18 +10:00
Peter Hutterer
4c1b9f3c70 gitlab CI: move MR check to a later stage
This gives the developer enough time to file an MR after pushing a branch.
Having this run in the first stage means we get false positives because no MR
has been filed yet when the job is run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-30 10:51:11 +10:00
Peter Hutterer
94a09a40bd gitlab CI: fix the repo name for excluding checks on master
Fixes 2698867311

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-16 16:16:11 +10:00
Peter Hutterer
2698867311 gitlab CI: use ci-fairy to check commits and merge requests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-16 09:58:56 +10:00
Peter Hutterer
0ebdab6d6c include: sync event codes with kernel 5.7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-04 12:56:08 +10:00
Peter Hutterer
4c87209826 gitlab CI: move the pip dependencies to before_script
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-04 10:48:04 +10:00
Peter Hutterer
55e70c5fd2 gitlab CI: alpine needs pip explicitly installed now
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-04 10:47:35 +10:00
Peter Hutterer
744a0e0f0b Add a CODING_STYLE document
Copied from libinput with a few minor changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-02 11:11:20 +10:00
George Thomas
1354b29b17 Add link to Haskell bindings
Signed-off-by: George Thomas <georgefsthomas@gmail.com>
2020-06-02 00:19:59 +01:00
Peter Hutterer
7660726177 Match if/else blocks for curly braces
Where either block has braces, the other half should too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-26 14:10:31 +10:00
Peter Hutterer
2e41b6778b tools: specify width by height in the edge-detector help
Fixes #13

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-07 07:56:57 +10:00
Peter Hutterer
c6a765199a gitlab-ci: update to ubuntu 20.04
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-01 16:52:51 +10:00
Peter Hutterer
521edcba27 tools: rename the example device in the touchpad-edge-detector
In the hope that people don't blindly type event0 from now on.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-28 07:15:53 +10:00
Peter Hutterer
f9302c18b7 gitlab CI: update docs for how to schedule the auth variable
Safer to have this defined in the scheduled job only rather than the project
itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-18 12:46:14 +10:00
Peter Hutterer
325839e640 gitlab CI: move to use ci-fairy
ci-templates now has a new tool ci-fairy that replaces our jinja generation
script with something (eventually) unified across project repositories. Let's
move the files to the expected locations .gitlab-ci/config.yml and
.gitlab-ci/ci.template.

ci-fairy also has a wrapper to delete images, let's start using that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-18 12:43:48 +10:00
Peter Hutterer
9ffed2f2f4 gitlab CI: use the new templates with a single job only
No more ifnot-exists, it's all build now with a variable to control the forced
rebuild.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-17 21:54:17 +10:00
Peter Hutterer
87a91718ef Don't overrun the changes array when synching > MAX_SLOTS
On a device with more than 256 slots we would read (and copy) past our changes
stack-allocated changes array. Fix this by capping to MAX_SLOTS though this
also requires us to memset the target where it is larger than MAX_SLOTS.

There are no real devices with 256+ slots, so this is a theoretical issue
only.

Fixes #11

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-13 14:07:25 +10:00
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