mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-07 22:50:13 +01:00
protocol: Make timestamps a single 64 bit argument
With 64 bit integers on the wire, we don't need to split timestamps in milliseconds and microsecond parts.
This commit is contained in:
parent
03c0ab73dd
commit
eecf69af48
3 changed files with 8 additions and 10 deletions
|
|
@ -708,8 +708,7 @@
|
|||
of an ei_connection_setup.context_type other than sender.
|
||||
</description>
|
||||
<arg name="last_serial" type="uint32" summary="the last serial sent by the EIS implementation"/>
|
||||
<arg name="timestamp" type="uint32" summary="timestamp in milliseconds"/>
|
||||
<arg name="micros" type="uint32" summary="microseconds in addition to the millis"/>
|
||||
<arg name="timestamp" type="uint64" summary="timestamp in microseconds"/>
|
||||
</request>
|
||||
|
||||
<!-- ei_device events version 1 -->
|
||||
|
|
@ -980,8 +979,7 @@
|
|||
of an ei_connection_setup.context_type other than receiver.
|
||||
</description>
|
||||
<arg name="serial" type="uint32" summary="this event's serial number"/>
|
||||
<arg name="timestamp" type="uint32" summary="timestamp in milliseconds"/>
|
||||
<arg name="micros" type="uint32" summary="microseconds in addition to the millis"/>
|
||||
<arg name="timestamp" type="uint64" summary="timestamp in microseconds"/>
|
||||
</event>
|
||||
</interface>
|
||||
|
||||
|
|
|
|||
|
|
@ -360,14 +360,14 @@ maybe_error_on_device_state(struct ei_device *device, const char *event_type)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_frame(struct ei_device *device, uint32_t serial, uint32_t time, uint32_t micros)
|
||||
handle_msg_frame(struct ei_device *device, uint32_t serial, uint64_t time)
|
||||
{
|
||||
DISCONNECT_IF_SENDER_CONTEXT(device);
|
||||
|
||||
ei_update_serial(ei_device_get_context(device), serial);
|
||||
|
||||
if (device->state == EI_DEVICE_STATE_EMULATING) {
|
||||
ei_queue_frame_event(device, ms2us(time) + micros);
|
||||
ei_queue_frame_event(device, time);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1620,7 +1620,7 @@ ei_device_frame(struct ei_device *device, uint64_t time)
|
|||
|
||||
device->send_frame_event = false;
|
||||
|
||||
int rc = ei_device_request_frame(device, ei_get_serial(ei), us2ms(time), time % 1000);
|
||||
int rc = ei_device_request_frame(device, ei_get_serial(ei), time);
|
||||
if (rc)
|
||||
ei_disconnect(ei_device_get_context(device));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -320,14 +320,14 @@ maybe_error_on_device_state(struct eis_device *device, const char *event_type)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
client_msg_frame(struct eis_device *device, uint32_t serial, uint32_t time, uint32_t micros)
|
||||
client_msg_frame(struct eis_device *device, uint32_t serial, uint64_t time)
|
||||
{
|
||||
eis_client_update_client_serial(eis_device_get_client(device), serial);
|
||||
|
||||
DISCONNECT_IF_RECEIVER_CONTEXT(device);
|
||||
|
||||
if (device->state == EIS_DEVICE_STATE_EMULATING) {
|
||||
eis_queue_frame_event(device, ms2us(time) + micros);
|
||||
eis_queue_frame_event(device, time);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1211,7 +1211,7 @@ eis_device_frame(struct eis_device *device, uint64_t time)
|
|||
device->send_frame_event = false;
|
||||
|
||||
eis_device_event_frame(device, eis_client_get_next_serial(client),
|
||||
us2ms(time), time % 1000);
|
||||
time);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue