platform/upstream/libevdev.git
6 years agotest: add a test timeout multiplier for valgrind
Peter Hutterer [Mon, 9 Jul 2018 01:48:21 +0000 (11:48 +1000)]
test: add a test timeout multiplier for valgrind

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoGitLab CI: actually reference the default artifacts
Peter Hutterer [Mon, 9 Jul 2018 01:13:03 +0000 (11:13 +1000)]
GitLab CI: actually reference the default artifacts

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoGitLab CI: build with the various options
Peter Hutterer [Fri, 29 Jun 2018 01:23:36 +0000 (11:23 +1000)]
GitLab CI: build with the various options

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoAdd GitLab CI
Peter Hutterer [Fri, 15 Jun 2018 05:41:01 +0000 (15:41 +1000)]
Add GitLab CI

A simple version of it, we just pull down a few popular distros, build on them
and make sure distcheck passes.

https://gitlab.freedesktop.org/libevdev/libevdev/issues/2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoconfigure.ac: remove --disable-test-run
Peter Hutterer [Fri, 15 Jun 2018 06:23:04 +0000 (16:23 +1000)]
configure.ac: remove --disable-test-run

This flag was used to disable test runs during make distcheck. Now that we
have more checks and the environment variable, we can drop this flag.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoconfigure.ac: fix the gcov linker flags
Peter Hutterer [Fri, 29 Jun 2018 01:49:51 +0000 (11:49 +1000)]
configure.ac: fix the gcov linker flags

Presumably this worked, but it certainly doesn't work anymore (neither on
RHEL7 nor on Fedora 28)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: add LIBEVDEV_SKIP_ROOT_TESTS environment variable check
Peter Hutterer [Fri, 29 Jun 2018 01:13:44 +0000 (11:13 +1000)]
test: add LIBEVDEV_SKIP_ROOT_TESTS environment variable check

Depending on the container, or other checks don't always work. Add an extra
environment variable instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: move the kernel test to the same infrastructure
Peter Hutterer [Fri, 15 Jun 2018 05:18:17 +0000 (15:18 +1000)]
test: move the kernel test to the same infrastructure

We previously had this separate because it tested separate things. Now the
setup is generic enough that we should just re-use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: check for the device nodes to exist before testing
Peter Hutterer [Fri, 15 Jun 2018 05:08:53 +0000 (15:08 +1000)]
test: check for the device nodes to exist before testing

Even if we're root we may be running in a container without input device
nodes. In which case we should skip the test, not fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: split some non-root tests into separate binaries
Peter Hutterer [Fri, 15 Jun 2018 04:40:18 +0000 (14:40 +1000)]
test: split some non-root tests into separate binaries

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: sort-of autodetect whether we need root privileges
Peter Hutterer [Fri, 15 Jun 2018 04:51:19 +0000 (14:51 +1000)]
test: sort-of autodetect whether we need root privileges

It's not really autodetection, we just declare the test suites that need root
privs. But this way we can generically check for it from the main() that we
re-use across tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: automate test suite handling
Peter Hutterer [Fri, 15 Jun 2018 04:36:37 +0000 (14:36 +1000)]
test: automate test suite handling

Move all tests to a special section, then loop through that section
to fetch all test suite. The result is that new tests only need to add the
source files without having to update everything else as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: rename some tests for less ambiguity
Peter Hutterer [Fri, 15 Jun 2018 04:13:59 +0000 (14:13 +1000)]
test: rename some tests for less ambiguity

"key" usually refers to one of KEY_ of EV_KEY in general, but here we're
testing event codes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoChange all URLs to gitlab.fdo
Peter Hutterer [Wed, 6 Jun 2018 08:20:03 +0000 (18:20 +1000)]
Change all URLs to gitlab.fdo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoUpdate struct input_event
Deepa Dinamani [Tue, 16 Jan 2018 00:21:08 +0000 (16:21 -0800)]
Update struct input_event

The struct input_event is not y2038 safe.
Update the struct according to the kernel patch:
https://lkml.org/lkml/2018/1/6/324

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoinclude: sync event codes with kernel 4.16
Peter Hutterer [Mon, 2 Apr 2018 21:04:12 +0000 (07:04 +1000)]
include: sync event codes with kernel 4.16

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibevdev 1.5.9 libevdev-1.5.9
Peter Hutterer [Thu, 8 Mar 2018 05:25:28 +0000 (15:25 +1000)]
libevdev 1.5.9

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: skip tests when we're not root
Peter Hutterer [Mon, 26 Feb 2018 07:09:48 +0000 (17:09 +1000)]
test: skip tests when we're not root

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoBlacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED
Peter Hutterer [Mon, 26 Feb 2018 07:02:41 +0000 (17:02 +1000)]
Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED

They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Blacklist it in the script here, causing it to resolve from name to code, but
not from code to name (like other duplicated codes).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoBlacklist REP_MAX so it doesn't shadow REP_PERIOD
Peter Hutterer [Mon, 26 Feb 2018 06:59:58 +0000 (16:59 +1000)]
Blacklist REP_MAX so it doesn't shadow REP_PERIOD

They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoDrop the python map printing
Peter Hutterer [Mon, 26 Feb 2018 06:53:55 +0000 (16:53 +1000)]
Drop the python map printing

leftover from when this was part of evemu

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agolibevdev 1.5.8 libevdev-1.5.8
Peter Hutterer [Mon, 29 Jan 2018 04:17:50 +0000 (14:17 +1000)]
libevdev 1.5.8

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoSync with kernel 4.15 (BTN_STYLUS3)
Peter Hutterer [Sun, 28 Jan 2018 21:59:49 +0000 (07:59 +1000)]
Sync with kernel 4.15 (BTN_STYLUS3)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: add --no-install flag to be able to debug directly
Peter Hutterer [Tue, 12 Dec 2017 23:46:15 +0000 (09:46 +1000)]
test: add --no-install flag to be able to debug directly

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoWhen changing the fd, reset our grab state to ungrabbed
Peter Hutterer [Tue, 12 Dec 2017 23:20:55 +0000 (09:20 +1000)]
When changing the fd, reset our grab state to ungrabbed

Previously, calling grabbing a device after changing the fd was a no-op
because libevdev's grab state didn't match the fd:

libevdev_grab(LIBEVDEV_GRAB);
  .. fd is grabbed
  .. internal state is 'grabbed'
libevdev_change_fd();
  .. new fd is ungrabbed
  .. internal state is 'grabbed'
libevdev_grab(LIBEVDEV_GRAB);
  .. argument matches internal state and we exit without grabbing the device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoinclude: sync with kernel 4.13
Peter Hutterer [Mon, 4 Sep 2017 02:44:14 +0000 (12:44 +1000)]
include: sync with kernel 4.13

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: add a script to sync the kernel header files
Peter Hutterer [Mon, 3 Jul 2017 00:13:06 +0000 (10:13 +1000)]
tools: add a script to sync the kernel header files

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoinclude: sync with kernel v4.12
Peter Hutterer [Mon, 3 Jul 2017 00:12:56 +0000 (10:12 +1000)]
include: sync with kernel v4.12

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agouinput: make a note that the syspath we return is the input node
Peter Hutterer [Wed, 31 May 2017 23:28:57 +0000 (09:28 +1000)]
uinput: make a note that the syspath we return is the input node

And not the syspath for the /dev/input/eventX node

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: remove test for ULONG_MAX queue allocation
Peter Hutterer [Tue, 9 May 2017 03:39:46 +0000 (13:39 +1000)]
test: remove test for ULONG_MAX queue allocation

Fixes the warning:
../libevdev/libevdev-int.h:231:15: warning: argument 1 value
18446744073709551615’ exceeds maximum object size 9223372036854775807
[-Walloc-size-larger-than=]

That's now part of gcc's -Wall, so let's rely on that for code. Arguably, the
queue code is simple enough that we don't need a test for ENOMEM anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotest: drop unused parameters from test's main()
Peter Hutterer [Mon, 8 May 2017 22:13:53 +0000 (08:13 +1000)]
test: drop unused parameters from test's main()

Not needed, so let's get rid of the compiler warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotest: disable coredumps during test suite runs
Peter Hutterer [Mon, 8 May 2017 22:12:43 +0000 (08:12 +1000)]
test: disable coredumps during test suite runs

It's a test suite, it shouldn't fill up the file system or the journal with
coredumps.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agolibevdev 1.5.7 upstream_bkup_20200211 libevdev-1.5.7
Peter Hutterer [Thu, 4 May 2017 00:31:51 +0000 (10:31 +1000)]
libevdev 1.5.7

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoFix an indentation issues
Peter Hutterer [Mon, 24 Apr 2017 23:27:16 +0000 (09:27 +1000)]
Fix an indentation issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: add links to git repositories on the main page
Peter Hutterer [Fri, 24 Mar 2017 04:42:00 +0000 (14:42 +1000)]
doc: add links to git repositories on the main page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoautogen: add default patch prefix
Mihail Konev [Thu, 26 Jan 2017 04:24:42 +0000 (14:24 +1000)]
autogen: add default patch prefix

Signed-off-by: Mihail Konev <k.mvc@ya.ru>
7 years agoautogen.sh: use exec for configure
Peter Hutterer [Thu, 26 Jan 2017 04:23:18 +0000 (14:23 +1000)]
autogen.sh: use exec for configure

No point in waiting around until it finishes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoautogen.sh: escape $srcdir before configure
Peter Hutterer [Thu, 26 Jan 2017 04:22:34 +0000 (14:22 +1000)]
autogen.sh: escape $srcdir before configure

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: print an error if we don't have any matching events in the dpi tool
Peter Hutterer [Tue, 17 Jan 2017 04:42:48 +0000 (14:42 +1000)]
tools: print an error if we don't have any matching events in the dpi tool

Beats crashing by dereferencing a null-pointer (when we access
m->frequencies[idx])

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotools: move udev printf into the print_summary() helper
Peter Hutterer [Tue, 17 Jan 2017 04:42:13 +0000 (14:42 +1000)]
tools: move udev printf into the print_summary() helper

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agoconfigure.ac: enable subdir-objects
Peter Hutterer [Thu, 5 Jan 2017 23:48:48 +0000 (09:48 +1000)]
configure.ac: enable subdir-objects

The main thing holding us back here was our gcov hacks. We used to rebuild the
libevdev sources locally inside test/ with the gcov flags so that we could
leave the main libevdev sources untouched. This doesn't work well with
subdir-objects - we have to link to libevdev.la instead.

To enable gcov, we now have to apply the gcov flags to the main library
object. But this also means that when running, the notes files will be
somewhere within the libevdev/ directory, not the test/ directory. Working
around this in automake gets nasty quickly, so just add a script that knows
how to search for things.

No functional changes unless --enable-gcov is given at configure time - then
don't install the library.

The gcov reports are now in test/gcov-reports/

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotest: fix a Makefile.am comment
Peter Hutterer [Fri, 6 Jan 2017 01:20:04 +0000 (11:20 +1000)]
test: fix a Makefile.am comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibevdev 1.5.6 libevdev-1.5.6
Peter Hutterer [Wed, 4 Jan 2017 03:04:58 +0000 (13:04 +1000)]
libevdev 1.5.6

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoFix typos in Documentation
Nayan Deshmukh [Sun, 1 Jan 2017 12:13:26 +0000 (17:43 +0530)]
Fix typos in Documentation

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoinclude: update to v4.9 linux/input.h headers
Peter Hutterer [Mon, 12 Dec 2016 00:07:07 +0000 (10:07 +1000)]
include: update to v4.9 linux/input.h headers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibevdev 1.5.5 libevdev-1.5.5
Peter Hutterer [Tue, 29 Nov 2016 23:52:11 +0000 (09:52 +1000)]
libevdev 1.5.5

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoDisable test runs on make distcheck
Peter Hutterer [Wed, 30 Nov 2016 00:13:22 +0000 (10:13 +1000)]
Disable test runs on make distcheck

The tests all need root, but running distcheck as root is not ideal. Disable
the test runs (but not the build) to make it easier to verify distcheck works
as intended.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agoFix minor error in doxygen example code
Nathan Baker [Thu, 10 Nov 2016 15:08:11 +0000 (10:08 -0500)]
Fix minor error in doxygen example code

The incorrect variable was checked as a return code in an example, and
that can be confusing for people trying to learn or use the example code
as a starting point.

7 years agotools: print the mean frequency together with the max frequency
Peter Hutterer [Mon, 19 Sep 2016 00:51:52 +0000 (10:51 +1000)]
tools: print the mean frequency together with the max frequency

And if they're 30% out, print a warning. On the ThinkPad X1 Wireless Touch
Mouse (when connected via bluetooth) we get a bunch of events at the start of
the movement, all less than 1ms apart. Best guess is that the device goes to
low-power, then notices the movement and buffers the event until the BT
connection is back up. Then it sends all events at once. Usually they're less
than 1ms apart, but at one recording showed a 37ms delay before we go back to
the normal 70ms (~15Hz) the mouse has otherwise.

This is unpredictable enough that we can't just work around it so instead
print a warning to the user so they can go investigate.

https://bugs.freedesktop.org/show_bug.cgi?id=97812

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotools: rename frequency to max_frequency in the dpi tool
Peter Hutterer [Mon, 19 Sep 2016 00:37:14 +0000 (10:37 +1000)]
tools: rename frequency to max_frequency in the dpi tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: use uint64_t, not doubles for the µs parameters
Peter Hutterer [Thu, 15 Sep 2016 21:26:42 +0000 (07:26 +1000)]
tools: use uint64_t, not doubles for the µs parameters

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix kernel-announced width/height
Peter Hutterer [Thu, 15 Sep 2016 01:53:44 +0000 (11:53 +1000)]
tools: fix kernel-announced width/height

Side-effect of 240ba34ebd483 was that "touchpad size as listed by the kernel"
was now dependent on the values we got. This one is a static one based on the
axis info.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: drop the HTML_TIMESTAMP
Peter Hutterer [Wed, 24 Aug 2016 04:30:14 +0000 (14:30 +1000)]
doc: drop the HTML_TIMESTAMP

Allows for reproducible builds. Debian carries a patch for this, and the
timestamp doesn't really add much since the doc is either in sync with master
or represents the release tag. Might as well drop it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibevdev 1.5.4 libevdev-1.5.4
Peter Hutterer [Fri, 26 Aug 2016 02:01:34 +0000 (12:01 +1000)]
libevdev 1.5.4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix the touchpad resolution calculation
Peter Hutterer [Thu, 25 Aug 2016 21:54:01 +0000 (07:54 +1000)]
tools: fix the touchpad resolution calculation

Previous ones used the absinfo from the kernel but since we never updated that
from within the tool, the output was always the same.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibevdev 1.5.3 libevdev-1.5.3
Peter Hutterer [Sun, 21 Aug 2016 21:36:01 +0000 (07:36 +1000)]
libevdev 1.5.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoDon't bother sanitizing disabled event codes
Peter Hutterer [Wed, 17 Aug 2016 00:48:43 +0000 (10:48 +1000)]
Don't bother sanitizing disabled event codes

Filter them immediately instead of passing them on and relying on the actual
event handling code to filter them.

Reproducer: if EV_ABS is disabled on an Apple MagicMouse we still get events
passed into sanitize_event(). But the code handling EV_ABS events doesn't
update the state, so we end up complaining about double tracking IDs, even
though that is not actually correct.

https://bugzilla.redhat.com/show_bug.cgi?id=1361325

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agotools: require a minimum size for touchpads
Peter Hutterer [Sun, 31 Jul 2016 21:45:46 +0000 (07:45 +1000)]
tools: require a minimum size for touchpads

This mostly aims to catch users trying to specify the size in inches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: change touchpad-edge-detector to require physical size
Peter Hutterer [Wed, 13 Jul 2016 01:33:43 +0000 (11:33 +1000)]
tools: change touchpad-edge-detector to require physical size

Almost no-one does the calculations for me to update the udev rules (and some
rules were submitted with the <x resolution> placeholders left in).
Require the user to specify the physical size so we just copy/paste the actual
udev rule.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agolibevdev 1.5.2 libevdev-1.5.2
Peter Hutterer [Wed, 15 Jun 2016 06:11:41 +0000 (16:11 +1000)]
libevdev 1.5.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoinclude: update to v4.6 linux/input.h header
Peter Hutterer [Sun, 15 May 2016 23:51:55 +0000 (09:51 +1000)]
include: update to v4.6 linux/input.h header

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agolibevdev 1.5.1 libevdev-1.5.1
Peter Hutterer [Sun, 15 May 2016 23:01:35 +0000 (09:01 +1000)]
libevdev 1.5.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agolibevdev: Properly distribute uinput.h
Armin K [Sat, 14 May 2016 12:02:52 +0000 (14:02 +0200)]
libevdev: Properly distribute uinput.h

Signed-off-by: Armin K <krejzi@email.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agolibevdev 1.5 libevdev-1.5.0
Peter Hutterer [Fri, 13 May 2016 03:50:44 +0000 (13:50 +1000)]
libevdev 1.5

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: allow numeric axis values in tweak-device
Peter Hutterer [Fri, 22 Apr 2016 00:10:39 +0000 (10:10 +1000)]
tools: allow numeric axis values in tweak-device

Not all axes a device may have are assigned a semantic name.

https://bugs.freedesktop.org/show_bug.cgi?id=95029

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix tweak-device option parsing
Peter Hutterer [Tue, 10 Nov 2015 00:08:12 +0000 (10:08 +1000)]
tools: fix tweak-device option parsing

https://bugs.freedesktop.org/show_bug.cgi?id=92880

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: reduce doxygen file to the non-default settings
Peter Hutterer [Thu, 21 Apr 2016 22:07:19 +0000 (08:07 +1000)]
doc: reduce doxygen file to the non-default settings

Makes it easier to check what we changed from the defaults.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoFix typo in doc string
Peter Hutterer [Wed, 20 Apr 2016 01:31:38 +0000 (11:31 +1000)]
Fix typo in doc string

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agouinput: support the new UI_DEV_SETUP/UI_ABS_SETUP ioctls
Peter Hutterer [Wed, 6 Apr 2016 06:29:18 +0000 (16:29 +1000)]
uinput: support the new UI_DEV_SETUP/UI_ABS_SETUP ioctls

Available in kernel 4.5 and later (uinput version 5), these ioctls allow us to
set the absinfo correctly, i.e. including the resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agouinput: split uinput device creation into a helper function
Peter Hutterer [Wed, 6 Apr 2016 05:32:56 +0000 (15:32 +1000)]
uinput: split uinput device creation into a helper function

No functional changes. This is prep work for supporting the new
UIDEV_DEV_SETUP ioctl.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agouinput: drop an unused argument
Peter Hutterer [Wed, 6 Apr 2016 06:04:22 +0000 (16:04 +1000)]
uinput: drop an unused argument

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agoinclude: update to v4.5 linux/uinput.h
Peter Hutterer [Wed, 6 Apr 2016 05:55:10 +0000 (15:55 +1000)]
include: update to v4.5 linux/uinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agoAdd parsing linux/input-event-codes.h, update to kernel v4.5
Peter Hutterer [Thu, 17 Mar 2016 01:02:50 +0000 (11:02 +1000)]
Add parsing linux/input-event-codes.h, update to kernel v4.5

The kernel has split most of the event codes out to a new header but the FF_
bits are missing from that header. Until this is fixed upstream, change the
event code parsing so it can take two files (using cat and stdin) so we can
update the kernel headers again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agotest: ignore a failure to UI_DEV_DESTROY the device
Peter Hutterer [Thu, 3 Mar 2016 21:17:18 +0000 (07:17 +1000)]
test: ignore a failure to UI_DEV_DESTROY the device

Coverity complains about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agotest: drop unnecessary return value
Peter Hutterer [Thu, 3 Mar 2016 21:10:33 +0000 (07:10 +1000)]
test: drop unnecessary return value

We abort if anything goes wrong anyway, so we never returned anything but
success.

Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 years agolibevdev 1.4.6 libevdev-1.4.6
Peter Hutterer [Tue, 5 Jan 2016 02:38:54 +0000 (12:38 +1000)]
libevdev 1.4.6

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agouinput: fix race condition in uinput syspath check
Peter Hutterer [Mon, 21 Dec 2015 23:02:46 +0000 (09:02 +1000)]
uinput: fix race condition in uinput syspath check

In theory, the device could change between stat() call and open(), resulting
in us opening the new device. Change to open() first, then fstat() on the fd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
8 years agotools: shut up coverity about a potential close(-1)
Peter Hutterer [Mon, 21 Dec 2015 23:18:37 +0000 (09:18 +1000)]
tools: shut up coverity about a potential close(-1)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix coverty "may be used uninitialized" warnings
Peter Hutterer [Mon, 21 Dec 2015 22:48:41 +0000 (08:48 +1000)]
tools: fix coverty "may be used uninitialized" warnings

tools/libevdev-tweak-device.c:390: uninit_use_in_call: Using uninitialized
value "changes" when calling "parse_options_abs".

tools/libevdev-tweak-device.c:376: warning: 'led' may be used uninitialized in
this function

tools/libevdev-tweak-device.c:375: warning: 'axis' may be used uninitialized
in this function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoDocument that the fd should be drained before libevdev_set_fd
Peter Hutterer [Wed, 16 Dec 2015 00:36:00 +0000 (10:36 +1000)]
Document that the fd should be drained before libevdev_set_fd

This is the caller's responsibility, for two reasons:
* we don't know if O_NONBLOCK is set, so draining the fd isn't a simple matter
  of read() until EAGAIN. A select() + read() could work around this of
  course.
* for stateless information, keys and relative data, it is not a problem when
  there are events waiting on the fd already, they are processed correctly,
  albeit with a delay.

So punt this decision to the caller, they openend the fd, they know if they
care about delayed events, they can drain the fd before handing it to us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
8 years agolibevdev 1.4.5 libevdev-1.4.5
Peter Hutterer [Wed, 11 Nov 2015 02:11:32 +0000 (12:11 +1000)]
libevdev 1.4.5

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix touchpad-edge-detector udev rule output
Peter Hutterer [Tue, 10 Nov 2015 02:49:45 +0000 (12:49 +1000)]
tools: fix touchpad-edge-detector udev rule output

off-by-one error on the ABS_ axes printed. ABS_X/Y are 0 and 1.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoAdd some more files to gitignore
Peter Hutterer [Tue, 10 Nov 2015 01:47:08 +0000 (11:47 +1000)]
Add some more files to gitignore

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agolibevdev 1.4.4 libevdev-1.4.4
Peter Hutterer [Tue, 1 Sep 2015 00:26:21 +0000 (10:26 +1000)]
libevdev 1.4.4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoFix invalid absinfo range values reported by certain mtk soc
Andreas Pokorny [Sun, 23 Aug 2015 16:27:28 +0000 (18:27 +0200)]
Fix invalid absinfo range values reported by certain mtk soc

This change will only affect certain touch screens, for which the driver
integration code does not provide meaningful values for the allowed range
of ABS_MT_TRACKING_IDs. The reported range [0, 0] will be overwritten with
[-1, 0xFFFF]

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
[Changed from INT_MAX to 0xFFFF to match the kernel, add device name to log
message]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: print out evdev override udev rule from touchpad edge detector
Peter Hutterer [Fri, 31 Jul 2015 00:45:38 +0000 (10:45 +1000)]
tools: print out evdev override udev rule from touchpad edge detector

We're starting to collect overrides for custom devices, making this easier for
users and saves us time. Once we measured everything, print out a
guesstimated udev rule and instructions on how to calculate the resolution.
Extra output now is:

Touchpad size as listed by the kernel: 132x111mm
Calculate resolution as:
x axis: 6076/<width in mm>
y axis: 5021/<height in mm>

Suggested udev rule:
# <Laptop model description goes here>
evdev:input:b0005v05ACp030E*
 EVDEV_ABS_01=-2694:2862:<x resolution>
 EVDEV_ABS_02=-20:121:<y resolution>
 EVDEV_ABS_35=-2694:2862:<x resolution>
 EVDEV_ABS_36=-20:121:<y resolution>

The ABS_MT_ axes are only printed if the device have them, if the device isn't
bluetooth/usb we print the dmi modalias instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools - tweak-device: add a --resolution command
Peter Hutterer [Mon, 29 Jun 2015 02:13:40 +0000 (12:13 +1000)]
tools - tweak-device: add a --resolution command

So far, 100% of the usages for tweak-tool was to set the x/y resolution of a
device. Make --resolution a shortcut for this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
9 years agotools - tweak-device: revamp to reduce use of globals
Peter Hutterer [Mon, 29 Jun 2015 00:44:10 +0000 (10:44 +1000)]
tools - tweak-device: revamp to reduce use of globals

Make the code base a bit more modular so it's easier to add new commands.
Main change here is: options are parsed twice now, first time for the mode
(abs/led) and the device path, then again for the mode-specific options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
9 years agoNote that libevdev_free() does not close the fd
Peter Hutterer [Mon, 29 Jun 2015 02:23:34 +0000 (12:23 +1000)]
Note that libevdev_free() does not close the fd

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools - tweak-device: fix wrong error message if the LED doesn't exist
Peter Hutterer [Mon, 29 Jun 2015 01:53:29 +0000 (11:53 +1000)]
tools - tweak-device: fix wrong error message if the LED doesn't exist

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools - tweak-device: close the fd on exit
Peter Hutterer [Mon, 29 Jun 2015 01:55:45 +0000 (11:55 +1000)]
tools - tweak-device: close the fd on exit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolibevdev 1.4.3 libevdev-1.4.3
Peter Hutterer [Mon, 22 Jun 2015 06:57:35 +0000 (16:57 +1000)]
libevdev 1.4.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoinclude: update to 4.1 header
Peter Hutterer [Mon, 22 Jun 2015 05:53:48 +0000 (15:53 +1000)]
include: update to 4.1 header

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: complain about devices that don't have abs x/y axes in the edge detector
Peter Hutterer [Tue, 13 Jan 2015 00:45:22 +0000 (10:45 +1000)]
tools: complain about devices that don't have abs x/y axes in the edge detector

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: widen frequency resolution to µs in the DPI tool
Peter Hutterer [Thu, 21 May 2015 01:48:34 +0000 (11:48 +1000)]
tools: widen frequency resolution to µs in the DPI tool

The Microsoft Arc Touch Mouse claims 8000fps which is higher than we can
measure in the current milliseconds resolution.
http://www.cnet.com/products/microsoft-arc-touch-mouse-black-series/specs/

https://bugs.freedesktop.org/show_bug.cgi?id=90540

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolibevdev 1.4.2 libevdev-1.4.2
Peter Hutterer [Fri, 24 Apr 2015 01:52:54 +0000 (11:52 +1000)]
libevdev 1.4.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: fix help string for manual DPI calculation
Peter Hutterer [Thu, 23 Apr 2015 00:36:55 +0000 (10:36 +1000)]
tools: fix help string for manual DPI calculation

https://bugs.freedesktop.org/show_bug.cgi?id=90143

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoinclude: update to 4.0 header
Peter Hutterer [Mon, 13 Apr 2015 00:06:03 +0000 (10:06 +1000)]
include: update to 4.0 header

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolibevdev 1.4.1 libevdev-1.4.1
Peter Hutterer [Wed, 8 Apr 2015 00:41:59 +0000 (10:41 +1000)]
libevdev 1.4.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAccept LIBEVDEV_READ_FLAG_BLOCKING as valid flag
Peter Hutterer [Mon, 6 Apr 2015 21:12:01 +0000 (07:12 +1000)]
Accept LIBEVDEV_READ_FLAG_BLOCKING as valid flag

https://bugs.freedesktop.org/show_bug.cgi?id=89798

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>