Compare commits

...

8 commits
main ... 1.15.5

Author SHA1 Message Date
Peter Hutterer
5b500c0e74 libinput 1.15.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 10:01:55 +10:00
Peter Hutterer
7658efbd71 doc/api: remove invalid doxygen option
doxygen 1.8.17 shows this error:

error: Illegal format for option FILTER_PATTERNS, no equal sign ('=') specified for item '*.h'
error: Illegal format for option FILTER_PATTERNS, no equal sign ('=') specified for item '*.dox'

This was added in deadbf35c4 but I cannot figure out how this ever had any
effect based on the documentation for it. So let's drop it, I don't think it
has any effect anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 33c98fed54)
2020-04-11 09:13:14 +10:00
Peter Hutterer
c2fa055fa3 udev: don't use IMPORT+=
IMPORT really only supports == and != and for a short while udevd warned about
this before that warning was reverted again.

Where anything else is used, it falls back to ==. systemd upstream rules all
use a single = though, so let's stick with that to be consistent, even if it
is technically wrong (udevd will warn about this in debug mode).

See the long discussion in systemd upstream for details:
https://github.com/systemd/systemd/issues/14062

Fixes #461

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 281ecf10d1)
2020-04-11 09:07:42 +10:00
Peter Hutterer
ce1c4c5008 doc: update the jumping cursor docs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 150f5dc801)
2020-04-11 09:07:11 +10:00
Peter Hutterer
aec607ecb4 touchpad: ratelimit the touch jump tests
In most cases these days touch jumps aren't actually fixable, they don't have
any good heuristics we can employ to remove them. And, luckily, in most cases
it doesn't matter because the users only notice the issue because of the error
message. To avoid spamming the user's log, let's ratelimit it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d6eef77dd2)
2020-04-11 09:07:06 +10:00
Peter Hutterer
560ba890b3 tools: record: drop quotes from os-release information
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d80bbcb028)
2020-04-11 09:06:57 +10:00
Peter Hutterer
f7a6f751dd libinput 1.15.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-18 15:30:25 +10:00
Peter Hutterer
2189fd2c2e tools: record: fix dmi recording
Processing os-release in the same buffer that the dmi modalias used caused the
dmi to be recorded as 'dmi: "VERSION_ID=31"'. The cause for that was simply
that the dmi modalias was read but not printed until after the os-release
information was processed.

Fix this two-fold: rearrange that each part now reads and prints in
one go, and rename the buffers so we don't re-use them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 850925910f)
2020-03-18 15:29:50 +10:00
11 changed files with 120 additions and 36 deletions

View file

@ -10,7 +10,6 @@ MAX_INITIALIZER_LINES = 0
WARNINGS = YES
QUIET = YES
INPUT = "@builddir@"
FILTER_PATTERNS = *.h *.dox
IMAGE_PATH = "@builddir@"
GENERATE_HTML = YES
HTML_OUTPUT = api

View file

@ -14,10 +14,13 @@ position.
When libinput detects a cursor jump it prints a bug warning to the log with
the text **"Touch jump detected and discarded."** and a link to this page.
In most cases, this is a bug in the kernel driver and to libinput it appears
that the touch point moves from its previous position. The pointer jump can
usually be seen in the :ref:`libinput record <libinput-record>` output for the device:
.. note:: This warning is ratelimited and will stop appearing after a few
times, even if the touchpad jumps continue.
In most cases, this is a bug in the firmware (or kernel driver) and to
libinput it appears that the touch point moves from its previous position.
The pointer jump can usually be seen in the :ref:`libinput record
<libinput-record>` output for the device:
::
@ -50,9 +53,14 @@ usually be seen in the :ref:`libinput record <libinput-record>` output for the d
In this recording, the pointer jumps from its position 3752/2216 to
1640/4681 within a single frame. On this particular touchpad, this would
represent a physical move of almost 50mm. libinput detects some of these
jumps and discards the movement but otherwise continues as usual. However,
the bug should be fixed at the kernel level.
jumps and discards the movement but otherwise continues as usual.
If your only encounter with these jumps is the warning printed to the log,
libinput functions as intended.
When you encounter the warning in the log, please generate a recording of
your touchpad with :ref:`libinput record <libinput-record>` and file a bug.
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.

View file

@ -1,5 +1,5 @@
project('libinput', 'c',
version : '1.15.3',
version : '1.15.5',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.41.0')

View file

@ -1718,10 +1718,11 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time)
if (tp_detect_jumps(tp, t, time)) {
if (!tp->semi_mt)
evdev_log_bug_kernel(tp->device,
"Touch jump detected and discarded.\n"
"See %stouchpad-jumping-cursors.html for details\n",
HTTP_DOC_LINK);
evdev_log_bug_kernel_ratelimit(tp->device,
&tp->jump.warning,
"Touch jump detected and discarded.\n"
"See %stouchpad-jumping-cursors.html for details\n",
HTTP_DOC_LINK);
tp_motion_history_reset(t);
}
@ -3581,6 +3582,9 @@ tp_init(struct tp_dispatch *tp,
if (!use_touch_size)
tp_init_pressure(tp, device);
/* 5 warnings per 2 hours should be enough */
ratelimit_init(&tp->jump.warning, s2us(2 * 60 * 60), 5);
/* Set the dpi to that of the x axis, because that's what we normalize
to when needed*/
device->dpi = device->abs.absinfo_x->resolution * 25.4;

View file

@ -279,6 +279,10 @@ struct tp_dispatch {
*/
unsigned int fake_touches;
struct {
struct ratelimit warning;
} jump;
/* if pressure goes above high -> touch down,
if pressure then goes below low -> touch up */
struct {

View file

@ -312,3 +312,29 @@ error:
free(result);
return -1;
}
/**
* Strip any of the characters in what from the beginning and end of the
* input string.
*
* @return a newly allocated string with none of "what" at the beginning or
* end of string
*/
static inline char *
strstrip(const char *input, const char *what)
{
char *str, *last;
str = safe_strdup(&input[strspn(input, what)]);
last = str;
for (char *c = str; *c != '\0'; c++) {
if (!strchr(what, *c))
last = c + 1;
}
*last = '\0';
return str;
}

View file

@ -725,7 +725,7 @@ litest_init_device_udev_rules(struct litest_test_device *dev, FILE *f)
if (need_keyboard_builtin) {
fprintf(f, ""
"ATTRS{name}==\"litest %s*\","
" IMPORT{builtin}+=\"keyboard\"\n",
" IMPORT{builtin}=\"keyboard\"\n",
dev->name);
}

View file

@ -1033,6 +1033,44 @@ START_TEST(strjoin_test)
}
END_TEST
START_TEST(strstrip_test)
{
struct strstrip_test {
const char *string;
const char *expected;
const char *what;
} tests[] = {
{ "foo", "foo", "1234" },
{ "\"bar\"", "bar", "\"" },
{ "'bar'", "bar", "'" },
{ "\"bar\"", "\"bar\"", "'" },
{ "'bar'", "'bar'", "\"" },
{ "\"bar\"", "bar", "\"" },
{ "\"\"", "", "\"" },
{ "\"foo\"bar\"", "foo\"bar", "\"" },
{ "\"'foo\"bar\"", "foo\"bar", "\"'" },
{ "abcfooabcbarbca", "fooabcbar", "abc" },
{ "xxxxfoo", "foo", "x" },
{ "fooyyyy", "foo", "y" },
{ "xxxxfooyyyy", "foo", "xy" },
{ "x xfooy y", " xfooy ", "xy" },
{ " foo\n", "foo", " \n" },
{ "", "", "abc" },
{ "", "", "" },
{ NULL , NULL, NULL }
};
struct strstrip_test *t = tests;
while (t->string) {
char *str;
str = strstrip(t->string, t->what);
ck_assert_str_eq(str, t->expected);
free(str);
t++;
}
}
END_TEST
START_TEST(list_test_insert)
{
struct list_test {
@ -1138,6 +1176,7 @@ litest_utils_suite(void)
tcase_add_test(tc, strsplit_test);
tcase_add_test(tc, kvsplit_double_test);
tcase_add_test(tc, strjoin_test);
tcase_add_test(tc, strstrip_test);
tcase_add_test(tc, time_conversion);
tcase_add_test(tc, list_test_insert);

View file

@ -1430,37 +1430,26 @@ print_system_header(struct record_context *ctx)
struct utsname u;
const char *kernel = "unknown";
FILE *dmi, *osrelease;
char buf[2048] = "unknown";
if (uname(&u) != -1)
kernel = u.release;
dmi = fopen("/sys/class/dmi/id/modalias", "r");
if (dmi) {
if (fgets(buf, sizeof(buf), dmi)) {
buf[strlen(buf) - 1] = '\0'; /* linebreak */
} else {
sprintf(buf, "unknown");
}
fclose(dmi);
}
char dmistr[2048] = "unknown";
iprintf(ctx, "system:\n");
indent_push(ctx);
/* /etc/os-release version and distribution name */
osrelease = fopen("/etc/os-release", "r");
if (!osrelease)
osrelease = fopen("/usr/lib/os-release", "r");
if (osrelease) {
char *distro = NULL, *version = NULL;
char osrstr[256] = "unknown";
while (fgets(buf, sizeof(buf), osrelease)) {
buf[strlen(buf) - 1] = '\0'; /* linebreak */
while (fgets(osrstr, sizeof(osrstr), osrelease)) {
osrstr[strlen(osrstr) - 1] = '\0'; /* linebreak */
if (!distro && strneq(buf, "ID=", 3))
distro = safe_strdup(&buf[3]);
else if (!version && strneq(buf, "VERSION_ID=", 11))
version = safe_strdup(&buf[11]);
if (!distro && strneq(osrstr, "ID=", 3))
distro = strstrip(&osrstr[3], "\"'");
else if (!version && strneq(osrstr, "VERSION_ID=", 11))
version = strstrip(&osrstr[11], "\"'");
if (distro && version) {
iprintf(ctx, "os: \"%s:%s\"\n", distro, version);
@ -1471,8 +1460,23 @@ print_system_header(struct record_context *ctx)
free(version);
fclose(osrelease);
}
/* kernel version */
if (uname(&u) != -1)
kernel = u.release;
iprintf(ctx, "kernel: \"%s\"\n", kernel);
iprintf(ctx, "dmi: \"%s\"\n", buf);
/* dmi modalias */
dmi = fopen("/sys/class/dmi/id/modalias", "r");
if (dmi) {
if (fgets(dmistr, sizeof(dmistr), dmi)) {
dmistr[strlen(dmistr) - 1] = '\0'; /* linebreak */
} else {
sprintf(dmistr, "unknown");
}
fclose(dmi);
}
iprintf(ctx, "dmi: \"%s\"\n", dmistr);
indent_pop(ctx);
}

View file

@ -1,6 +1,6 @@
ACTION!="add|change", 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"
ATTRS{phys}=="?*", IMPORT{program}="@UDEV_TEST_PATH@libinput-device-group %S%p"
LABEL="libinput_device_group_end"

View file

@ -15,12 +15,12 @@ KERNEL!="event*", GOTO="libinput_fuzz_override_end"
# about that.
ATTRS{capabilities/abs}!="0", \
ENV{ID_INPUT_TOUCHPAD}=="1", \
IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \
GOTO="libinput_fuzz_override_end"
ATTRS{capabilities/abs}!="0", \
ENV{ID_INPUT_TOUCHSCREEN}=="1", \
IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \
GOTO="libinput_fuzz_override_end"