Monado OpenXR Runtime
Loading...
Searching...
No Matches

Server side IPC code. More...

Collaboration diagram for Server IPC:

Modules

 Server Internals
 These are only called by the platform-specific mainloop polling code.
 

Files

file  ipc_server.h
 Common server side code.
 
file  ipc_server_handler.c
 Handling functions called from generated dispatch function.
 
file  ipc_server_interface.h
 Interface for IPC server code.
 
file  ipc_server_mainloop_android.c
 Server mainloop details on Android.
 
file  ipc_server_mainloop_android.h
 Additional server entry points needed for Android.
 
file  ipc_server_mainloop_linux.c
 Server mainloop details on Linux.
 
file  ipc_server_mainloop_windows.cpp
 Server mainloop details on Windows.
 
file  ipc_server_objects.c
 Tracking objects to IDs.
 
file  ipc_server_objects.h
 Tracking objects to IDs.
 
file  ipc_server_per_client_thread.c
 Per client thread listening on the socket.
 
file  ipc_server_process.c
 Server process functions.
 

Data Structures

struct  ipc_swapchain_data
 Information about a single swapchain. More...
 
struct  ipc_client_state
 Holds the state for a single client. More...
 
struct  ipc_server_mainloop
 Platform-specific mainloop object for the IPC server. More...
 
struct  ipc_server
 Main IPC object for the server. More...
 
struct  ipc_server_main_info
 Information passed into the IPC server main function, used for customization of the IPC server. More...
 
struct  ipc_server_callbacks
 

Functions

xrt_result_t ipc_server_init_system_if_available_locked (struct ipc_server *s, volatile struct ipc_client_state *ics, bool *out_available)
 Finish setting up the server by creating the system, compositor and devices.
 
xrt_result_t ipc_server_get_client_app_state (struct ipc_server *s, uint32_t client_id, struct ipc_app_state *out_ias)
 Get the current state of a client.
 
xrt_result_t ipc_server_set_active_client (struct ipc_server *s, uint32_t client_id)
 Set the new active client.
 
xrt_result_t ipc_server_toggle_io_client (struct ipc_server *s, uint32_t client_id)
 Toggle the io for this client.
 
xrt_result_t ipc_server_set_client_io_blocks (struct ipc_server *s, uint32_t client_id, const struct ipc_client_io_blocks *blocks)
 Block certain types of IO for this client.
 
void ipc_server_activate_session (volatile struct ipc_client_state *ics)
 Called by client threads to set a session to active.
 
void ipc_server_deactivate_session (volatile struct ipc_client_state *ics)
 Called by client threads to set a session to deactivate.
 
void ipc_server_update_state (struct ipc_server *s)
 Called by client threads to recalculate active client.
 
void * ipc_server_client_thread (void *_ics)
 Thread function for the client side dispatching.
 
int ipc_server_main_common (const struct ipc_server_main_info *ismi, const struct ipc_server_callbacks *iscb, void *data)
 Common main function for starting the IPC service.
 
int ipc_server_main (int argc, char **argv, const struct ipc_server_main_info *ismi)
 Main entrypoint to the compositor process.
 
xrt_result_t ipc_server_objects_get_xdev_and_validate (volatile struct ipc_client_state *ics, uint32_t id, struct xrt_device **out_xdev)
 Device functions.
 
xrt_result_t ipc_server_objects_get_xdev_id_or_add (volatile struct ipc_client_state *ics, struct xrt_device *xdev, uint32_t *out_id)
 Get a device ID for a given device object, must only be called from the per client thread as this function accesses the client state's memory.
 
xrt_result_t ipc_server_objects_get_xtrack_and_validate (volatile struct ipc_client_state *ics, uint32_t id, struct xrt_tracking_origin **out_xtrack)
 Tracking origin functions.
 
xrt_result_t ipc_server_objects_get_xtrack_id_or_add (volatile struct ipc_client_state *ics, struct xrt_tracking_origin *xtrack, uint32_t *out_id)
 Get a tracking origin ID for a given tracking origin object, must only be called from the per client thread as this function accesses the client state's memory.
 

Detailed Description

Server side IPC code.

Function Documentation

◆ ipc_server_activate_session()

void ipc_server_activate_session ( volatile struct ipc_client_state ics)

#include <ipc/server/ipc_server.h>

Called by client threads to set a session to active.

References ipc_client_state::server.

◆ ipc_server_client_thread()

void * ipc_server_client_thread ( void *  _ics)

#include <ipc/server/ipc_server.h>

Thread function for the client side dispatching.

Referenced by ipc_server_handle_client_connected().

◆ ipc_server_deactivate_session()

void ipc_server_deactivate_session ( volatile struct ipc_client_state ics)

#include <ipc/server/ipc_server.h>

Called by client threads to set a session to deactivate.

References ipc_client_state::server.

◆ ipc_server_get_client_app_state()

xrt_result_t ipc_server_get_client_app_state ( struct ipc_server s,
uint32_t  client_id,
struct ipc_app_state out_ias 
)

#include <ipc/server/ipc_server.h>

Get the current state of a client.

◆ ipc_server_init_system_if_available_locked()

xrt_result_t ipc_server_init_system_if_available_locked ( struct ipc_server s,
volatile struct ipc_client_state ics,
bool out_available 
)

#include <ipc/server/ipc_server.h>

Finish setting up the server by creating the system, compositor and devices.

References ipc_client_state::has_init_shm_system, XRT_SUCCESS, xso, xsys, xsysc, and xsysd.

Referenced by ipc_server_main_common().

◆ ipc_server_main()

◆ ipc_server_main_common()

◆ ipc_server_objects_get_xdev_and_validate()

xrt_result_t ipc_server_objects_get_xdev_and_validate ( volatile struct ipc_client_state ics,
uint32_t  id,
struct xrt_device **  out_xdev 
)

#include <ipc/server/ipc_server_objects.h>

Device functions.

Get a device by ID, must only be called from the per client thread as this function accesses the client state's memory.

Parameters
icsThe client state instance.
idThe device ID.
out_xdevWill be filled with the device object on success.
Returns
XRT_SUCCESS on success, some other result on failure.

References ipc_client_state::server, ipc_client_state::xdevs, XRT_ERROR_IPC_FAILURE, XRT_SUCCESS, and XRT_SYSTEM_MAX_DEVICES.

◆ ipc_server_objects_get_xdev_id_or_add()

xrt_result_t ipc_server_objects_get_xdev_id_or_add ( volatile struct ipc_client_state ics,
struct xrt_device xdev,
uint32_t *  out_id 
)

#include <ipc/server/ipc_server_objects.h>

Get a device ID for a given device object, must only be called from the per client thread as this function accesses the client state's memory.

Parameters
icsThe client state instance.
xdevThe device object.
out_idWill be filled with the device ID on success.
Returns
XRT_SUCCESS on success, some other result on failure.

References ipc_server_objects_get_xtrack_id_or_add(), ipc_client_state::server, xrt_device::str, xrt_device::tracking_origin, ipc_client_state::xdevs, XRT_ERROR_IPC_FAILURE, XRT_SUCCESS, and XRT_SYSTEM_MAX_DEVICES.

◆ ipc_server_objects_get_xtrack_and_validate()

xrt_result_t ipc_server_objects_get_xtrack_and_validate ( volatile struct ipc_client_state ics,
uint32_t  id,
struct xrt_tracking_origin **  out_xtrack 
)

#include <ipc/server/ipc_server_objects.h>

Tracking origin functions.

Get a tracking origin by ID, must only be called from the per client thread as this function accesses the client state's memory.

Parameters
icsThe client state instance.
idThe tracking origin ID.
out_xtrackWill be filled with the tracking origin object on success.
Returns
XRT_SUCCESS on success, some other result on failure.

References ipc_client_state::server, XRT_ERROR_IPC_FAILURE, XRT_SUCCESS, XRT_SYSTEM_MAX_DEVICES, and ipc_client_state::xtracks.

◆ ipc_server_objects_get_xtrack_id_or_add()

xrt_result_t ipc_server_objects_get_xtrack_id_or_add ( volatile struct ipc_client_state ics,
struct xrt_tracking_origin xtrack,
uint32_t *  out_id 
)

#include <ipc/server/ipc_server_objects.h>

Get a tracking origin ID for a given tracking origin object, must only be called from the per client thread as this function accesses the client state's memory.

Parameters
icsThe client state instance.
xtrackThe tracking origin object.
out_idWill be filled with the tracking origin ID on success.
Returns
XRT_SUCCESS on success, some other result on failure.

References xrt_tracking_origin::name, ipc_client_state::server, XRT_ERROR_IPC_FAILURE, XRT_SUCCESS, XRT_SYSTEM_MAX_DEVICES, and ipc_client_state::xtracks.

Referenced by ipc_server_objects_get_xdev_id_or_add().

◆ ipc_server_set_active_client()

xrt_result_t ipc_server_set_active_client ( struct ipc_server s,
uint32_t  client_id 
)

#include <ipc/server/ipc_server.h>

Set the new active client.

◆ ipc_server_set_client_io_blocks()

xrt_result_t ipc_server_set_client_io_blocks ( struct ipc_server s,
uint32_t  client_id,
const struct ipc_client_io_blocks blocks 
)

#include <ipc/server/ipc_server.h>

Block certain types of IO for this client.

◆ ipc_server_toggle_io_client()

xrt_result_t ipc_server_toggle_io_client ( struct ipc_server s,
uint32_t  client_id 
)

#include <ipc/server/ipc_server.h>

Toggle the io for this client.

◆ ipc_server_update_state()

void ipc_server_update_state ( struct ipc_server s)

#include <ipc/server/ipc_server.h>

Called by client threads to recalculate active client.