Compare commits

...

22 commits
main ... 1.16.5

Author SHA1 Message Date
Peter Hutterer
1b560b01fe libinput 1.16.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-24 10:29:07 +10:00
Peter Hutterer
35c661aa3a gitlab CI: run the scan-build analysis jobs in script
after_script ignores any exit status so we can't actually fail the job here

Fixes #573

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3eb428ef56)
2021-02-24 09:47:38 +10:00
Gablegritule
39ac181ffc quirks: add pressure ranges for the Dell Latitude E5510 TouchPad
The default setting makes the "Dell Latitude E5510 TouchPad" too sensitive and
consequently difficult to use.

Note that the the size of the TouchPad is detected to be higher than it is
(the side-bars are half out of the TouchPad), see
https://github.com/systemd/systemd/pull/18493 for the hwdb overrides for this
device.

Signed-off-by: Gablegritule <guillet.gabriel@laposte.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9f594664d9)
2021-02-24 09:47:02 +10:00
Gary Wolfe
8ea7880344 Dell touchpad was too sensitive with default settings
The touchpad for the Dell Inspiron 15R N5110 was too sensitive with default
settings, leading to excessive movement when lifting finger.

Fixes #565

Signed-off-by: Gary Wolfe <avidgamefan@yahoo.com>
(cherry picked from commit 3f15bc3985)
2021-02-24 09:45:48 +10:00
Peter Hutterer
46c1bd1430 quirks: disable pressure on the Lenovo Yoga 9i touchpad
This touchpad is a true pressurepad and the pressure axis gives us physical
pressure down. Using it as contact size gives flaky touch detection, so let's
just disable the axis until we do something with that value.

Fixes #562

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 53595cb232)
2021-02-24 09:44:49 +10:00
Blaž Hrastnik
d90af8ab14 Match all Surface (Pro/Laptop/Book) devices.
Signed-off-by: Blaž Hrastnik <blaz@mxxn.io>
(cherry picked from commit aec8e0b4ef)
2020-12-17 14:24:28 +10:00
Jef Driesen
173599e7b9 quirks: add quirk for Dell XPS 15 9500 touchpad
The Dell XPS 15 9500 has a large touchpad without any visible markers
for the touchpad buttons. Since the ModelTouchpadVisibleMarker quirk is
enabled by default for all Dell touchpads, the middle button area ends
up too small. Disable the quirk again for this specific model.

Fixes #545

Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
(cherry picked from commit 4ce0d41b3a)
2020-12-17 14:24:20 +10:00
Peter Hutterer
edddb5c0a1 libinput 1.16.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-11-27 10:36:26 +10:00
Peter Hutterer
d625520be1 udev: update rules to handle bind/unbind events
Summary: we expect add, change or remove but kernel 4.12 added bind and
unbind. These events were previously discarded by udevd. Our rules should
handle any event *but* remove, so update as suggested in the announce email
linked below.

For a longer explanation, see the system 247rc2 announcement
https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cd37dcfa66)
2020-11-27 08:12:32 +10:00
Peter Hutterer
602820f820 Fix a few coverity complaints
All minor:
- execdir does not need initialization, it's not used until written to
- 'newest' could be NULL
- zalloc(-1) confuses coverity
- 't' is never used in that test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cfd8e6c76c)
2020-11-16 13:44:05 +10:00
Peter Hutterer
dc1edd140f Fix the termination of the readlink result
nread is the number of bytes put into the buffer, let's terminate it there
instead of one byte over. This only worked because execdir was initialized to
zero.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 34fe17f723)
2020-11-16 13:43:26 +10:00
Peter Hutterer
66b2d85a5e libinput 1.16.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-11-03 14:14:40 +10:00
Peter Hutterer
e84dfbb731 doc/user: update the timer offset warning for the new "too slow" message
Related #533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 11d517f969)
2020-10-29 12:32:05 +10:00
Peter Hutterer
1e547e2baa evdev: reduce the "your system is slow" warning to 5 per hour
Two cases where this can happen: system is currently slow and delaying events,
n which case we'll get a burst and it'll show up in the log files anyway. Or
the system is generally slow and we get these warnings all the time. In the
latter case, let's not spam the log.

Fixes #533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5faa3b7ae9)
2020-10-29 12:32:04 +10:00
Peter Hutterer
4cfe13df44 libinput 1.16.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-07 10:19:41 +10:00
Peter Hutterer
2b632541db fallback: expand the range of valid keys
The kernel has since added a bunch of keys in the range between
KEY_ONSCREEN_KEYBOARD and BTN_TRIGGER_HAPPY. Let's designate those as keys so
we handle them correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a80fe32503)
2020-10-07 09:49:56 +10:00
Davide Depau
c6ab679fef quirks: fix force-press on Apple Magic Trackpad 2
The current defaults detect force presses as palm or thumb.
The values provided here work for a 99% accurate palm/thumb detection
and provide close zero false positives in my tests.

Signed-off-by: Davide Depau <davide@depau.eu>
(cherry picked from commit ec939611fd)
2020-10-07 08:15:14 +10:00
Kai-Chuan Hsieh
dcf05cd757 quirks: Customize ALPS i2c touchpad palm detect pressure threshold
ALPS i2c touchpad support ABS_PRESSURE and ABS_MT_PRESSURE capabilities,
The default threshold 130 is too easy to across while finger movement.
It will cause the cursor stalled after the threshold is achieved, which
impacts user experience.
Test with some ALPS touchpads 0488:101A, 0488:101D, 0488:101E, the value
180 is good on those platforms.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
(cherry picked from commit f0997536a7)
2020-10-07 08:15:08 +10:00
Peter Hutterer
c856f26dd7 touchpad: ignore the ALPS jump to 4095/0
Some ALPS touchpad send the occasional 4095/0 event on slot 1 during
two-finger interaction before snapping back to the actual position of the
finger. There doesn't seem to be a specific heuristic to predict this so let's
hardcode those values. When detected, overwrite the current touch point with
the position of the last point. This will likely cause a small pointer jump
when the finger later moves to the real position but based on #492 this could
be a second later, so all bets are off anyway.

Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/492

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0c51121556)
2020-10-07 08:14:21 +10:00
Peter Hutterer
2e5e74c0bc tools: fix a replay exception when a recording has an empty quirks list
Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/520

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit e926d3d919)
2020-10-07 08:14:15 +10:00
Peter Hutterer
768880d7b9 gitlab CI: drop Fedora 30
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 36f1c85b1e)
2020-10-07 08:14:08 +10:00
Alyssa Ross
029959c93f quirks: add Google Pixelbook (eve)
Signed-off-by: Alyssa Ross <hi@alyssa.is>
(cherry picked from commit 81e6179b1e)
2020-10-07 08:14:04 +10:00
25 changed files with 245 additions and 67 deletions

View file

@ -202,17 +202,6 @@ fedora:32@qemu-prep:
FDO_DISTRIBUTION_PACKAGES: $FEDORA_QEMU_RPMS
allow_failure: true
fedora:30@container-prep:
extends:
- .fdo.container-build@fedora
- .policy
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '30'
FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
fedora:31@container-prep:
extends:
- .fdo.container-build@fedora
@ -355,16 +344,6 @@ freebsd:11.2@container-prep:
only:
- schedules
fedora:30@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
FEDORA_VERSION: '30'
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '30'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
fedora:31@container-clean:
extends:
- .container-clean
@ -664,7 +643,8 @@ scan-build@fedora:32:
MESON_TEST_ARGS: ''
before_script:
- dnf install -y clang-analyzer findutils
after_script:
script:
- .gitlab-ci/meson-build.sh
- test ! -d "$MESON_BUILDDIR"/meson-logs/scanbuild && exit 0
- test $(find "$MESON_BUILDDIR"/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 && exit 0
- echo "Check scan-build results"
@ -807,18 +787,6 @@ coverity:
# #
#################################################################
fedora:30@default-build:
stage: distro
extends:
- .build@template
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '30'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:30@container-prep"
fedora:31@default-build:
stage: distro
extends:

View file

@ -485,7 +485,8 @@ scan-build@{{distro.name}}:{{version}}:
MESON_TEST_ARGS: ''
before_script:
- dnf install -y clang-analyzer findutils
after_script:
script:
- .gitlab-ci/meson-build.sh
- test ! -d "$MESON_BUILDDIR"/meson-logs/scanbuild && exit 0
- test $(find "$MESON_BUILDDIR"/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 && exit 0
- echo "Check scan-build results"

View file

@ -9,7 +9,6 @@ distributions:
- name: fedora
tag: *default_tag
versions:
- '30'
- '31'
- '32'
want_qemu: true

View file

@ -287,28 +287,28 @@ details on the hwdb and how to modify it locally.
.. _faq_timer_offset:
------------------------------------------------------------------------------
What causes the "timer offset negative" warning?
What causes the "your system is too slow" warning?
------------------------------------------------------------------------------
libinput relies on the caller to call **libinput_dispatch()** whenever data is
available on the epoll-fd. Doing so will process the state of all devices
and can trigger some timers to be set (e.g. palm detection, tap-to-click,
disable-while-typing, etc.). Internally, libinput's time offsets are always
based on the event time of the triggering event.
available. **libinput_dispatch()** will process the state of all devices,
including some time-sensitive features (e.g. palm detection, tap-to-click,
disable-while-typing, etc.).
For example, a touch event with time T may trigger a timer for the time T +
180ms. When setting a timer, libinput checks the wall clock time to ensure
that this time T + offset is still in the future. If not, the warning is
logged.
If the time between the event and the call to **libinput_dispatch()**
is excessive, those features may not work correctly. For example, a delay in
touch event processing may cause wrong or missing tap-to-click events or
a palm may not be detected correctly.
When this warning appears, it simply means that too much time has passed
between the event occurring (and the epoll-fd triggering) and the current
time. In almost all cases this is an indication of the caller being
overloaded and not handling events as speedily as required.
between the event occurring and the current time. In almost all cases this
is an indication of the caller being overloaded and not handling events as
speedily as required.
The warning has no immediate effect on libinput's behavior but some of the
functionality that relies on the timer may be impeded (e.g. palms are not
detected as they should be).
functionality that relies on the timer may be impeded. This is not a bug in
libinput. libinput does not control how quickly **libinput_dispatch()** is
called.
.. _faq_wayland:

View file

@ -64,3 +64,17 @@ See :ref:`reporting_bugs` for more details.
Note that it most cases, libinput cannot actually fix the issue. Filing a
bug is useful to figure out if there are other factors at play or whether
there are heuristics we can employ to reduce the impact.
------------------------------------------------------------------------------
AlpsPS/2 ALPS DualPoint TouchPad jumping to 4095/0
------------------------------------------------------------------------------
A special case of pointer jumps happens on ``AlpsPS/2 ALPS DualPoint TouchPad``
devices found in the Lenovo ThinkPad E465 and E550 and likely others with
the same touchpad hardware. On those devices, the touchpad occasionally
sends an event for the second finger to move to position 4095/0 before
moving back to the original position. libinput detects this movement and
removes it but depending on the interaction this may cause a smaller jump
later when the coordinates reset to the new position of the finger.
Some more information is available in `Gitlab Issue #492 <https://gitlab.freedesktop.org/libinput/libinput/-/issues/492>`__.

View file

@ -1,5 +1,5 @@
project('libinput', 'c',
version : '1.16.1',
version : '1.16.5',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.45.0')
@ -803,6 +803,7 @@ if get_option('tests')
'test/litest-device-synaptics-x220.c',
'test/litest-device-synaptics-hover.c',
'test/litest-device-synaptics-i2c.c',
'test/litest-device-synaptics-pressurepad.c',
'test/litest-device-synaptics-rmi4.c',
'test/litest-device-synaptics-st.c',
'test/litest-device-synaptics-t440.c',

View file

@ -19,6 +19,12 @@ MatchVendor=0x0002
MatchProduct=0x0008
ModelALPSSerialTouchpad=1
[ALPS i2c Touchpads]
MatchUdevType=touchpad
MatchBus=i2c
MatchVendor=0x0488
AttrPalmPressureThreshold=180
[ALPS v8 Touchpads]
MatchUdevType=touchpad
MatchBus=ps2

View file

@ -5,9 +5,14 @@ MatchName=*Lid Switch*
MatchDMIModalias=dmi:*svnMicrosoftCorporation:pnSurface3:*
AttrLidSwitchReliability=write_open
[Microsoft Surface 3 Type Cover Keyboard]
MatchName=*Microsoft Surface Type Cover Keyboard*
MatchDMIModalias=dmi:*svnMicrosoftCorporation:pnSurface3:*
# Matches both Surface Laptop keyboards as well as type covers.
# i.e.
# - Surface 3: Microsoft Surface 3 Type Cover Keyboard
# - Surface Laptop 3: Microsoft Surface 045E:09AE Keyboard
# - Surface Book 2: Microsoft Surface Keyboard
[Microsoft Surface Keyboard]
MatchName=*Microsoft Surface *Keyboard*
MatchDMIModalias=dmi:*svnMicrosoftCorporation:*
AttrKeyboardIntegration=internal
[Microsoft Nano Transceiver v2.0]

View file

@ -57,7 +57,8 @@ MatchProduct=0x0265
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
AttrThumbSizeThreshold=800
AttrPalmPressureThreshold=190
[Apple Magic Trackpad v2 (new vendor ID)]
MatchVendor=0x004C
@ -65,7 +66,8 @@ MatchProduct=0x0265
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
AttrThumbSizeThreshold=800
AttrPalmPressureThreshold=190
[Apple Touchpad OneButton]
MatchUdevType=touchpad

View file

@ -11,6 +11,18 @@ MatchUdevType=touchpad
MatchDMIModalias=dmi:*svnDellInc.:*
AttrMscTimestamp=watch
[Dell Inspiron 15R N5110 Touchpad]
MatchUdevType=touchpad
MatchName=*AlpsPS/2 ALPS GlidePoint
MatchDMIModalias=dmi:*svnDellInc.:*pnInspironN5110*
AttrPressureRange=100:95
[Dell Latitude E5510 Touchpad]
MatchUdevType=touchpad
MatchName=*AlpsPS/2 ALPS GlidePoint
MatchDMIModalias=dmi:*svnDellInc.:pnLatitudeE5510:*
AttrPressureRange=100:90
[Dell Lattitude E6220 Touchpad]
MatchName=*AlpsPS/2 ALPS GlidePoint
MatchDMIModalias=dmi:*svnDellInc.:pnLatitudeE6220:*
@ -28,6 +40,11 @@ MatchDMIModalias=dmi:*svnDellInc.:*pnXPS139333*
AttrPressureRange=15:10
AttrPalmPressureThreshold=150
[Dell XPS 15 9500 Touchpad]
MatchName=* Touchpad
MatchDMIModalias=dmi:*svnDellInc.:pnXPS159500:*
ModelTouchpadVisibleMarker=0
[Dell Latitude D620 Trackpoint]
MatchName=*DualPoint Stick
MatchDMIModalias=dmi:*svnDellInc.:pnLatitudeD620*

View file

@ -86,3 +86,11 @@ MatchUdevType=touchpad
MatchName=Atmel maXTouch Touchpad
MatchDMIModalias=dmi:*svn*GOOGLE*:pn*Samus*
ModelChromebook=1
[Google Chromebook Eve]
MatchUdevType=touchpad
MatchName=ACPI0C50:00 18D1:5028
MatchDMIModalias=dmi:*svnGoogle:pnEve*
ModelChromebook=1
AttrPressureRange=6:4
AttrThumbPressureThreshold=45

View file

@ -130,6 +130,14 @@ MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadX1Yoga1st:*
AttrTrackpointMultiplier=1.25
# A true pressurepad so let's not use pressure for contact size
# https://gitlab.freedesktop.org/libinput/libinput/-/issues/562
[Lenovo Yoga 9i Pressurepad]
MatchBus=i2c
MatchVendor=0x06CB
MatchProduct=0xCE37
AttrEventCodeDisable=ABS_MT_PRESSURE;ABS_PRESSURE;
# Lenovo Carbon X1 6th gen (RMI4 only, PS/2 is broken on this device,
# sends bogus ABS_MT_TOOL_TYPE events for MT_TOOL_PALM
[Lenovo Carbon X1 6th gen]

View file

@ -35,7 +35,7 @@
static inline char *
builddir_lookup(void)
{
char execdir[PATH_MAX] = {0};
char execdir[PATH_MAX];
char *pathsep;
ssize_t nread;
@ -50,7 +50,7 @@ builddir_lookup(void)
/* readlink doesn't terminate the string and readlink says
anything past sz is undefined */
execdir[++nread] = '\0';
execdir[nread] = '\0';
pathsep = strrchr(execdir, '/');
if (!pathsep)

View file

@ -194,7 +194,7 @@ get_key_type(uint16_t code)
return KEY_TYPE_KEY;
if (code >= BTN_DPAD_UP && code <= BTN_DPAD_RIGHT)
return KEY_TYPE_BUTTON;
if (code >= KEY_ALS_TOGGLE && code <= KEY_ONSCREEN_KEYBOARD)
if (code >= KEY_ALS_TOGGLE && code < BTN_TRIGGER_HAPPY)
return KEY_TYPE_KEY;
if (code >= BTN_TRIGGER_HAPPY && code <= BTN_TRIGGER_HAPPY40)
return KEY_TYPE_BUTTON;

View file

@ -358,8 +358,9 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
* the behavior of the other touches.)
*/
if ((newest->initial_time - oldest->initial_time) < THUMB_TIMEOUT &&
first->point.y < tp->thumb.lower_thumb_line) {
if (newest &&
(newest->initial_time - oldest->initial_time) < THUMB_TIMEOUT &&
first->point.y < tp->thumb.lower_thumb_line) {
tp_thumb_lift(tp);
return;
}

View file

@ -1542,6 +1542,19 @@ tp_detect_jumps(const struct tp_dispatch *tp,
abs_distance = hypot(mm.x, mm.y) * reference_interval/tdelta;
rel_distance = abs_distance - t->jumps.last_delta_mm;
/* Special case for the ALPS devices in the Lenovo ThinkPad E465,
* E550. These devices send occasional 4095/0 events on two fingers
* before snapping back to the correct position.
* https://gitlab.freedesktop.org/libinput/libinput/-/issues/492
* The specific values are hardcoded here, if this ever happens on
* any other device we can make it absmax/absmin instead.
*/
if (tp->device->model_flags & EVDEV_MODEL_ALPS_SERIAL_TOUCHPAD &&
t->point.x == 4095 && t->point.y == 0) {
t->point = last->point;
return true;
}
/* Cursor jump if:
* - current single-event delta is >20mm, or
* - we increased the delta by over 7mm within a 12ms frame.

View file

@ -2225,8 +2225,8 @@ evdev_device_create(struct libinput_seat *seat,
/* at most 5 SYN_DROPPED log-messages per 30s */
ratelimit_init(&device->syn_drop_limit, s2us(30), 5);
/* at most 5 "delayed processing" log messages per minute */
ratelimit_init(&device->delay_warning_limit, s2us(60), 5);
/* at most 5 "delayed processing" log messages per hour */
ratelimit_init(&device->delay_warning_limit, s2us(60 * 60), 5);
/* at most 5 log-messages per 5s */
ratelimit_init(&device->nonpointer_rel_limit, s2us(5), 5);

View file

@ -0,0 +1,120 @@
/*
* Copyright © 2021 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include "litest.h"
#include "litest-int.h"
/* Device from https://gitlab.freedesktop.org/libinput/libinput/-/issues/562 */
static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
{ .type = -1, .code = -1 },
};
static struct input_event move[] = {
{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
{ .type = -1, .code = -1 },
};
static int
get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value)
{
switch (evcode) {
/* Always set pressure to zero. The real device sends pressure
* values > 30 when the device is clicked but until this is a)
* handled by libinput and b) integrated into this test suite
* a zero value does the job.
*/
case ABS_PRESSURE:
case ABS_MT_PRESSURE:
*value = 0;
return 0;
}
return 1;
}
static struct litest_device_interface interface = {
.touch_down_events = down,
.touch_move_events = move,
.get_axis_default = get_axis_default,
};
static struct input_id input_id = {
.bustype = 0x18,
.vendor = 0x6cb,
.product = 0xce37,
};
static int events[] = {
EV_KEY, BTN_LEFT,
EV_KEY, BTN_TOOL_FINGER,
EV_KEY, BTN_TOUCH,
EV_KEY, BTN_TOOL_DOUBLETAP,
EV_KEY, BTN_TOOL_TRIPLETAP,
EV_KEY, BTN_TOOL_QUADTAP,
EV_KEY, BTN_TOOL_QUINTTAP,
INPUT_PROP_MAX, INPUT_PROP_POINTER,
INPUT_PROP_MAX, INPUT_PROP_BUTTONPAD,
-1, -1,
};
static struct input_absinfo absinfo[] = {
{ ABS_X, 0, 1224, 0, 0, 12 },
{ ABS_Y, 0, 756, 0, 0, 12 },
{ ABS_PRESSURE, 0, 255, 0, 0, 0 },
{ ABS_MT_SLOT, 0, 4, 0, 0, 0 },
{ ABS_MT_POSITION_X, 0, 1224, 0, 0, 12 },
{ ABS_MT_POSITION_Y, 0, 756, 0, 0, 12 },
{ ABS_MT_TRACKING_ID, 0, 65535, 0, 0, 0 },
{ ABS_MT_PRESSURE, 0, 255, 0, 0, 0 },
{ ABS_MT_TOOL_TYPE, 0, 2, 0, 0, 0 },
{ .value = -1 }
};
TEST_DEVICE("synaptics-pressurepad",
.type = LITEST_SYNAPTICS_PRESSUREPAD,
.features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON,
.interface = &interface,
.name = "SYNA2B31:00 06CB:CE37 Touchpad",
.id = &input_id,
.events = events,
.absinfo = absinfo,
)

View file

@ -350,7 +350,7 @@ END_TEST
START_TEST(zalloc_overflow)
{
zalloc(-1);
zalloc((size_t)-1);
}
END_TEST

View file

@ -306,6 +306,7 @@ enum litest_device_type {
LITEST_TABLET_MODE_UNRELIABLE,
LITEST_KEYBOARD_LOGITECH_MEDIA_KEYBOARD_ELITE,
LITEST_SONY_VAIO_KEYS,
LITEST_SYNAPTICS_PRESSUREPAD,
};
#define LITEST_DEVICELESS -2

View file

@ -2765,6 +2765,9 @@ touchpad_has_palm_pressure(struct litest_device *dev)
{
struct libevdev *evdev = dev->evdev;
if (dev->which == LITEST_SYNAPTICS_PRESSUREPAD)
return false;
if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_PRESSURE))
return true;

View file

@ -1795,6 +1795,9 @@ touchpad_has_palm_pressure(struct litest_device *dev)
{
struct libevdev *evdev = dev->evdev;
if (dev->which == LITEST_SYNAPTICS_PRESSUREPAD)
return false;
if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_PRESSURE))
return true;
@ -5913,6 +5916,9 @@ touchpad_has_pressure(struct litest_device *dev)
{
struct libevdev *evdev = dev->evdev;
if (dev->which == LITEST_SYNAPTICS_PRESSUREPAD)
return false;
if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_PRESSURE))
return true;

View file

@ -218,7 +218,12 @@ def create_device_quirk(device):
def setup_quirks(recording):
devices = fetch(recording, 'devices')
overrides = None
quirks = [create_device_quirk(d) for d in devices if 'quirks' in d]
quirks = []
for d in devices:
if 'quirks' in d:
quirk = create_device_quirk(d)
if quirk:
quirks.append(quirk)
if not quirks:
return None

View file

@ -1,4 +1,4 @@
ACTION!="add|change", GOTO="libinput_device_group_end"
ACTION=="remove", GOTO="libinput_device_group_end"
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
ATTRS{phys}=="?*", IMPORT{program}="@UDEV_TEST_PATH@libinput-device-group %S%p"

View file

@ -3,7 +3,7 @@
# This file contains lookup rules for libinput model-specific quirks.
# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME
ACTION!="add|change", GOTO="libinput_fuzz_override_end"
ACTION=="remove", GOTO="libinput_fuzz_override_end"
KERNEL!="event*", GOTO="libinput_fuzz_override_end"
# Two-step process: fuzz-extract sets the LIBINPUT_FUZZ property and