input: Embed TL_POINT at weston_input_event initialization

And with it, this starts tracking input events on the ingress side,
having always a distinct input event and with a Perfetto flow id.

On the egress side, Weston would then use this flow id to associate
with the input event.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2026-04-27 13:43:14 +03:00
parent c0d7bcd39a
commit cdbbc6129e
2 changed files with 3 additions and 18 deletions

View file

@ -52,6 +52,7 @@
#include "pointer-constraints-unstable-v1-server-protocol.h"
#include "input-timestamps-unstable-v1-server-protocol.h"
#include "tablet-unstable-v2-server-protocol.h"
#include "timeline.h"
enum pointer_constraint_type {
POINTER_CONSTRAINT_TYPE_LOCK,
@ -5978,6 +5979,8 @@ weston_input_event_init(struct weston_input_event *ievent, struct timespec *ts,
{
ievent->ts = ts;
ievent->seat = seat;
TL_POINT(seat->compositor, TLP_INPUT_KERNEL_TS, TLP_INPUT_EVENT(ievent), TLP_END);
}
WL_EXPORT void

View file

@ -44,7 +44,6 @@
#include "libinput-device.h"
#include "shared/helpers.h"
#include "shared/timespec-util.h"
#include "timeline.h"
#include "tablet-unstable-v2-server-protocol.h"
@ -112,8 +111,6 @@ handle_keyboard_key(struct libinput_device *libinput_device,
timespec_from_usec(&time, libinput_event_keyboard_get_time_usec(keyboard_event));
weston_input_event_init(&key_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&key_event.base_event), TLP_END);
weston_key_event_init(&key_event, key, key_state, STATE_UPDATE_AUTOMATIC);
notify_key(device->seat, &key_event);
@ -144,8 +141,6 @@ handle_pointer_motion(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, device->seat);
weston_pointer_motion_event_init(&event, WESTON_POINTER_MOTION_REL |
WESTON_POINTER_MOTION_REL_UNACCEL, NULL, &rel, &rel_unaccel);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
notify_motion(device->seat, &event);
return true;
@ -181,8 +176,6 @@ handle_pointer_motion_absolute(
height);
pos = weston_coord_global_from_output_point(x, y, output);
weston_input_event_init(&event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
weston_pointer_motion_event_init(&event, WESTON_POINTER_MOTION_ABS,
&pos, NULL, NULL);
notify_motion(device->seat, &event);
@ -216,8 +209,6 @@ handle_pointer_button(struct libinput_device *libinput_device,
libinput_event_pointer_get_time_usec(pointer_event));
weston_input_event_init(&button_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&button_event.base_event), TLP_END);
weston_pointer_button_event_init(&button_event,
libinput_event_pointer_get_button(pointer_event),
button_state);
@ -325,8 +316,6 @@ handle_pointer_axis(struct libinput_device *libinput_device,
vert = normalize_scroll(pointer_event, axis);
weston_input_event_init(&weston_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&weston_event.base_event), TLP_END);
weston_pointer_axis_event_init(&weston_event, WL_POINTER_AXIS_VERTICAL_SCROLL,
vert, (vert_discrete != 0), vert_discrete);
notify_axis(device->seat, &weston_event);
@ -338,8 +327,6 @@ handle_pointer_axis(struct libinput_device *libinput_device,
horiz = normalize_scroll(pointer_event, axis);
weston_input_event_init(&weston_event.base_event, &time, device->seat);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&weston_event.base_event), TLP_END);
weston_pointer_axis_event_init(&weston_event, WL_POINTER_AXIS_HORIZONTAL_SCROLL,
horiz, (horiz_discrete != 0), horiz_discrete);
notify_axis(device->seat, &weston_event);
@ -495,9 +482,6 @@ handle_touch_with_coords(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, seat);
weston_touch_event_init(&event, touch_type, touch_id, &pos);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
if (weston_touch_device_can_calibrate(device->touch_device)) {
norm.x = libinput_event_touch_get_x_transformed(touch_event, 1);
norm.y = libinput_event_touch_get_y_transformed(touch_event, 1);
@ -541,8 +525,6 @@ handle_touch_up(struct libinput_device *libinput_device,
weston_input_event_init(&event.base_event, &time, seat);
weston_touch_event_init(&event, WL_TOUCH_UP,
libinput_event_touch_get_seat_slot(touch_event), NULL);
TL_POINT(device->seat->compositor, TLP_INPUT_KERNEL_TS,
TLP_INPUT_EVENT(&event.base_event), TLP_END);
notify_touch(device->touch_device, &event);
}