plugin/evdev: drop the duplicate event frame printing

The plugin system prints all events before they're passed to the plugin
anyway and the special evdev plugin does not do anything but pass it on.
We can thus assume that the events passed to libinput are the same as
the ones passed to this plugin.

Let's do that and adjust the print format to be closer to what
evdev_log_debug() would print.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1276>
This commit is contained in:
Peter Hutterer 2025-07-21 09:45:09 +10:00
parent 80b45ff28e
commit 7a22eb8d08
2 changed files with 4 additions and 63 deletions

View file

@ -29,61 +29,6 @@
#include "evdev-plugin.h"
#include "evdev.h"
_unused_ static inline void
evdev_print_frame(struct evdev_device *device,
struct evdev_frame *frame,
uint64_t time_in_us)
{
static uint32_t offset = 0;
static uint32_t last_time = 0;
uint32_t time = us2ms(time_in_us);
if (offset == 0) {
offset = time;
last_time = time - offset;
}
time -= offset;
size_t nevents;
struct evdev_event *events = evdev_frame_get_events(frame, &nevents);
for (size_t i = 0; i < nevents; i++) {
struct evdev_event *e = &events[i];
switch (evdev_usage_enum(e->usage)) {
case EVDEV_SYN_REPORT:
evdev_log_debug(
device,
"%u.%03u ----------------- EV_SYN ----------------- +%ums\n",
time / 1000,
time % 1000,
time - last_time);
last_time = time;
break;
case EVDEV_MSC_SERIAL:
evdev_log_debug(device,
"%u.%03u %-16s %-16s %#010x\n",
time / 1000,
time % 1000,
evdev_event_get_type_name(e),
evdev_event_get_code_name(e),
e->value);
break;
default:
evdev_log_debug(device,
"%u.%03u %-16s %-20s %4d\n",
time / 1000,
time % 1000,
evdev_event_get_type_name(e),
evdev_event_get_code_name(e),
e->value);
break;
}
}
}
static inline void
evdev_process_frame(struct evdev_device *device,
struct evdev_frame *frame,
@ -91,10 +36,6 @@ evdev_process_frame(struct evdev_device *device,
{
struct evdev_dispatch *dispatch = device->dispatch;
#if EVENT_DEBUGGING
evdev_print_frame(device, frame, time);
#endif
libinput_timer_flush(evdev_libinput_context(device), time);
dispatch->interface->process(dispatch, device, frame, time);

View file

@ -603,10 +603,10 @@ plugin_system_notify_evdev_frame(struct libinput_plugin_system *system,
continue;
}
#ifdef EVENT_DEBUGGING
_autofree_ char *prefix =
strdup_printf("plugin %-25s - %s:",
plugin->name,
libinput_device_get_name(event->device));
_autofree_ char *prefix = strdup_printf(
"%7s: plugin %-15s - ",
libinput_device_get_sysname(event->device),
plugin->name);
print_frame(libinput_device_get_context(device),
event->frame,
prefix);