Monado OpenXR Runtime
ipc_client_xdev.h
Go to the documentation of this file.
1// Copyright 2020-2023, Collabora, Ltd.
2// Copyright 2025-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Shared functions for IPC client @ref xrt_device.
7 * @author Pete Black <pblack@collabora.com>
8 * @author Jakob Bornecrantz <jakob@collabora.com>
9 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
10 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
11 * @ingroup ipc_client
12 */
13
14#pragma once
15
16#include "util/u_device.h"
17
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23
24struct ipc_connection;
26
27/*!
28 * An IPC client proxy for an @ref xrt_device.
29 *
30 * @implements xrt_device
31 * @ingroup ipc_client
32 */
34{
35 struct xrt_device base;
36
37 struct ipc_connection *ipc_c;
38
39 uint32_t device_id;
40
41 struct xrt_binding_input_pair *all_input_pairs;
42 struct xrt_binding_output_pair *all_output_pairs;
43};
44
45/*!
46 * Convenience helper to go from a xdev to @ref ipc_client_xdev.
47 *
48 * @ingroup ipc_client
49 */
50static inline struct ipc_client_xdev *
52{
53 return (struct ipc_client_xdev *)xdev;
54}
55
56/*!
57 * Initializes a ipc_client_xdev so that it's basically fully usable as a
58 * @ref xrt_device object. Does not fill in the destroy function or the any
59 * if the HMD components / functions.
60 *
61 * @ingroup ipc_client
62 * @public @memberof ipc_client_xdev
63 */
66 struct ipc_connection *ipc_c,
68 uint32_t device_id,
70
71/*!
72 * Frees any memory that was allocated as part of init and resets some pointers.
73 *
74 * @ingroup ipc_client
75 * @public @memberof ipc_client_xdev
76 */
77void
79
80
81#ifdef __cplusplus
82}
83#endif
void(* u_device_destroy_function_t)(struct xrt_device *xdev)
Function pointer type for the device's destroy function.
Definition: u_device.h:228
void ipc_client_xdev_fini(struct ipc_client_xdev *icx)
Frees any memory that was allocated as part of init and resets some pointers.
Definition: ipc_client_xdev.c:658
static struct ipc_client_xdev * ipc_client_xdev(struct xrt_device *xdev)
Convenience helper to go from a xdev to ipc_client_xdev.
Definition: ipc_client_xdev.h:51
xrt_result_t ipc_client_xdev_init(struct ipc_client_xdev *icx, struct ipc_connection *ipc_c, struct ipc_client_tracking_origin_manager *itom, uint32_t device_id, u_device_destroy_function_t destroy_fn)
Initializes a ipc_client_xdev so that it's basically fully usable as a xrt_device object.
Definition: ipc_client_xdev.c:447
enum xrt_result xrt_result_t
Result type used across Monado.
Tracking origin manager for IPC client.
Definition: ipc_client_tracking_origin.h:32
An IPC client proxy for an xrt_device.
Definition: ipc_client_xdev.h:34
Connection.
Definition: ipc_client.h:63
A binding pair, going from a binding point to a device input.
Definition: xrt_device.h:217
A binding pair, going from a binding point to a device output.
Definition: xrt_device.h:228
A single HMD or input device.
Definition: xrt_device.h:310
Misc helpers for device drivers.