xrt/space: use int64_t to represent timestamps

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2298>
This commit is contained in:
Simon Zeni 2024-08-01 15:28:31 -04:00 committed by Rylie Pavlik
parent af5cf402bf
commit d67ab7845f
5 changed files with 22 additions and 22 deletions

View file

@ -312,7 +312,7 @@ notify_ref_space_usage_device(struct u_space_overseer *uso, enum xrt_reference_s
* order.
*/
static void
push_then_traverse(struct xrt_relation_chain *xrc, struct u_space *space, uint64_t at_timestamp_ns)
push_then_traverse(struct xrt_relation_chain *xrc, struct u_space *space, int64_t at_timestamp_ns)
{
switch (space->type) {
case U_SPACE_TYPE_NULL: break; // No-op
@ -340,7 +340,7 @@ push_then_traverse(struct xrt_relation_chain *xrc, struct u_space *space, uint64
* the reversed order.
*/
static void
traverse_then_push_inverse(struct xrt_relation_chain *xrc, struct u_space *space, uint64_t at_timestamp_ns)
traverse_then_push_inverse(struct xrt_relation_chain *xrc, struct u_space *space, int64_t at_timestamp_ns)
{
// Done traversing.
switch (space->type) {
@ -374,7 +374,7 @@ build_relation_chain_read_locked(struct u_space_overseer *uso,
struct xrt_relation_chain *xrc,
struct u_space *base,
struct u_space *target,
uint64_t at_timestamp_ns)
int64_t at_timestamp_ns)
{
assert(xrc != NULL);
assert(base != NULL);
@ -389,7 +389,7 @@ build_relation_chain(struct u_space_overseer *uso,
struct xrt_relation_chain *xrc,
struct u_space *base,
struct u_space *target,
uint64_t at_timestamp_ns)
int64_t at_timestamp_ns)
{
pthread_rwlock_rdlock(&uso->lock);
build_relation_chain_read_locked(uso, xrc, base, target, at_timestamp_ns);
@ -531,7 +531,7 @@ static xrt_result_t
locate_space(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space *space,
const struct xrt_pose *offset,
struct xrt_space_relation *out_relation)
@ -587,7 +587,7 @@ static xrt_result_t
locate_spaces(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space **spaces,
uint32_t space_count,
const struct xrt_pose *offsets,
@ -637,7 +637,7 @@ static xrt_result_t
locate_device(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_device *xdev,
struct xrt_space_relation *out_relation)
{

View file

@ -158,7 +158,7 @@ struct xrt_space_overseer
xrt_result_t (*locate_space)(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space *space,
const struct xrt_pose *offset,
struct xrt_space_relation *out_relation);
@ -180,7 +180,7 @@ struct xrt_space_overseer
xrt_result_t (*locate_spaces)(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space **spaces,
uint32_t space_count,
const struct xrt_pose *offsets,
@ -205,7 +205,7 @@ struct xrt_space_overseer
xrt_result_t (*locate_device)(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_device *xdev,
struct xrt_space_relation *out_relation);
@ -349,7 +349,7 @@ static inline xrt_result_t
xrt_space_overseer_locate_space(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space *space,
const struct xrt_pose *offset,
struct xrt_space_relation *out_relation)
@ -368,7 +368,7 @@ static inline xrt_result_t
xrt_space_overseer_locate_spaces(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space **spaces,
uint32_t space_count,
const struct xrt_pose *offsets,
@ -389,7 +389,7 @@ static inline xrt_result_t
xrt_space_overseer_locate_device(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_device *xdev,
struct xrt_space_relation *out_relation)
{

View file

@ -131,7 +131,7 @@ static xrt_result_t
locate_space(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space *space,
const struct xrt_pose *offset,
struct xrt_space_relation *out_relation)
@ -157,7 +157,7 @@ static xrt_result_t
locate_spaces(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_space **spaces,
uint32_t space_count,
const struct xrt_pose *offsets,
@ -218,7 +218,7 @@ static xrt_result_t
locate_device(struct xrt_space_overseer *xso,
struct xrt_space *base_space,
const struct xrt_pose *base_offset,
uint64_t at_timestamp_ns,
int64_t at_timestamp_ns,
struct xrt_device *xdev,
struct xrt_space_relation *out_relation)
{

View file

@ -533,7 +533,7 @@ xrt_result_t
ipc_handle_space_locate_space(volatile struct ipc_client_state *ics,
uint32_t base_space_id,
const struct xrt_pose *base_offset,
uint64_t at_timestamp,
int64_t at_timestamp,
uint32_t space_id,
const struct xrt_pose *offset,
struct xrt_space_relation *out_relation)
@ -572,7 +572,7 @@ ipc_handle_space_locate_spaces(volatile struct ipc_client_state *ics,
uint32_t base_space_id,
const struct xrt_pose *base_offset,
uint32_t space_count,
uint64_t at_timestamp)
int64_t at_timestamp)
{
IPC_TRACE_MARKER();
struct ipc_message_channel *imc = (struct ipc_message_channel *)&ics->imc;
@ -673,7 +673,7 @@ xrt_result_t
ipc_handle_space_locate_device(volatile struct ipc_client_state *ics,
uint32_t base_space_id,
const struct xrt_pose *base_offset,
uint64_t at_timestamp,
int64_t at_timestamp,
uint32_t xdev_id,
struct xrt_space_relation *out_relation)
{

View file

@ -122,7 +122,7 @@
"in": [
{"name": "base_space_id", "type": "uint32_t"},
{"name": "base_offset", "type": "struct xrt_pose"},
{"name": "at_timestamp", "type": "uint64_t"},
{"name": "at_timestamp", "type": "int64_t"},
{"name": "space_id", "type": "uint32_t"},
{"name": "offset", "type": "struct xrt_pose"}
],
@ -137,7 +137,7 @@
{"name": "base_space_id", "type": "uint32_t"},
{"name": "base_offset", "type": "struct xrt_pose"},
{"name": "space_count", "type": "uint32_t"},
{"name": "at_timestamp", "type": "uint64_t"}
{"name": "at_timestamp", "type": "int64_t"}
]
},
@ -145,7 +145,7 @@
"in": [
{"name": "base_space_id", "type": "uint32_t"},
{"name": "base_offset", "type": "struct xrt_pose"},
{"name": "at_timestamp", "type": "uint64_t"},
{"name": "at_timestamp", "type": "int64_t"},
{"name": "xdev_id", "type": "uint32_t"}
],
"out": [