fallback: add messages for touch arbitration debugging

This commit is contained in:
Peter Hutterer 2023-11-13 20:05:13 +10:00
parent c22ee58b4c
commit 19446a029b

View file

@ -968,9 +968,17 @@ fallback_interface_process(struct evdev_dispatch *evdev_dispatch,
uint64_t time)
{
struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch);
static bool warned = false;
if (dispatch->arbitration.in_arbitration)
if (dispatch->arbitration.in_arbitration) {
if (!warned) {
evdev_log_debug(device, "dropping events due to touch arbitration\n");
warned = true;
}
return;
}
warned = false;
switch (event->type) {
case EV_REL:
@ -1188,6 +1196,7 @@ fallback_interface_toggle_touch(struct evdev_dispatch *evdev_dispatch,
{
struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch);
struct device_coord_rect rect = {0};
const char *state = NULL;
if (which == dispatch->arbitration.state)
return;
@ -1203,20 +1212,25 @@ fallback_interface_toggle_touch(struct evdev_dispatch *evdev_dispatch,
* event is caught as palm touch. */
libinput_timer_set(&dispatch->arbitration.arbitration_timer,
time + ms2us(90));
state = "not-active";
break;
case ARBITRATION_IGNORE_RECT:
assert(phys_rect);
rect = evdev_phys_rect_to_units(device, phys_rect);
cancel_touches(dispatch, device, &rect, time);
dispatch->arbitration.rect = rect;
state = "ignore-rect";
break;
case ARBITRATION_IGNORE_ALL:
libinput_timer_cancel(&dispatch->arbitration.arbitration_timer);
fallback_return_to_neutral_state(dispatch, device);
dispatch->arbitration.in_arbitration = true;
state = "ignore-all";
break;
}
evdev_log_debug(device, "Touch arbitration state now %s\n", state);
dispatch->arbitration.state = which;
}
@ -1621,6 +1635,8 @@ fallback_arbitration_timeout(uint64_t now, void *data)
if (dispatch->arbitration.in_arbitration)
dispatch->arbitration.in_arbitration = false;
evdev_log_debug(dispatch->device, "touch arbitration timeout\n");
}
static void