Monado OpenXR Runtime

Client side IPC code. More...

Collaboration diagram for Client IPC:

Files

file  ipc_client.h
 Common client side code.
 
file  ipc_client_compositor.c
 Client side wrapper of compositor.
 
file  ipc_client_connection.c
 Just the client connection setup/teardown bits.
 
file  ipc_client_connection.h
 More-internal client side code.
 
file  ipc_client_device.c
 IPC Client device.
 
file  ipc_client_hmd.c
 IPC Client HMD device.
 
file  ipc_client_instance.c
 Client side wrapper of instance.
 
file  ipc_client_interface.h
 Interface for IPC client instance code.
 
file  ipc_client_session.c
 Client side wrapper of xrt_session.
 
file  ipc_client_space_overseer.c
 IPC Client space overseer.
 
file  ipc_client_system.c
 Client side wrapper of xrt_system.
 
file  ipc_client_system_devices.c
 IPC Client system devices.
 

Data Structures

struct  ipc_client_xdev
 An IPC client proxy for an xrt_device. More...
 
struct  ipc_client_session
 IPC client implementation of xrt_session. More...
 
struct  ipc_client_system
 IPC client implementation of xrt_system. More...
 

Macros

#define IPC_CHK_AND_RET(IPC_C, XRET, FUNC_STR)
 This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then returns XRET. More...
 
#define IPC_CHK_WITH_GOTO(IPC_C, XRET, FUNC_STR, GOTO)
 This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then gotos GOTO. More...
 
#define IPC_CHK_WITH_RET(IPC_C, XRET, FUNC_STR, RET)
 This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then returns RET. More...
 
#define IPC_CHK_ONLY_PRINT(IPC_C, XRET, FUNC_STR)
 This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, it only prints and does nothing else. More...
 
#define IPC_CHK_ALWAYS_RET(IPC_C, XRET, FUNC_STR)
 This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then it will always return the value. More...
 

Typedefs

typedef struct ipc_client_xdev ipc_client_device_t
 An IPC client proxy for an controller or other non-MHD xrt_device and ipc_client_xdev. More...
 
typedef struct ipc_client_xdev ipc_client_hmd_t
 An IPC client proxy for an HMD xrt_device and ipc_client_xdev. More...
 

Functions

static struct ipc_client_xdevipc_client_xdev (struct xrt_device *xdev)
 Convenience helper to go from a xdev to ipc_client_xdev. More...
 
xrt_result_t ipc_client_connection_init (struct ipc_connection *ipc_c, enum u_logging_level log_level, const struct xrt_instance_info *i_info)
 Set up the basics of the client connection: socket and shared mem. More...
 
static void ipc_client_connection_lock (struct ipc_connection *ipc_c)
 Locks the connection, allows sending complex messages. More...
 
static void ipc_client_connection_unlock (struct ipc_connection *ipc_c)
 Unlocks the connection. More...
 
void ipc_client_connection_fini (struct ipc_connection *ipc_c)
 Tear down the basics of the client connection: socket and shared mem. More...
 
xrt_result_t ipc_instance_create (struct xrt_instance_info *ii, struct xrt_instance **out_xinst)
 Create a IPC client instance, connects to a IPC server. More...
 

Detailed Description

Client side IPC code.

Macro Definition Documentation

◆ IPC_CHK_ALWAYS_RET

#define IPC_CHK_ALWAYS_RET (   IPC_C,
  XRET,
  FUNC_STR 
)

#include <ipc/client/ipc_client.h>

Value:
do { \
xrt_result_t _ret = XRET; \
if (_ret != XRT_SUCCESS) { \
ipc_print_result((IPC_C)->imc.log_level, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
} \
return _ret; \
} while (false)
@ XRT_SUCCESS
The operation succeeded.
Definition: xrt_results.h:26

This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then it will always return the value.

The argument IPC_C will be used to look up the cond_level for the ipc_print_result call.

Parameters
IPC_CClient connection, used to look up cond_level.
XRETThe xrt_result_t to check and always return.
FUNC_STRString literal with the function name, used for logging.

◆ IPC_CHK_AND_RET

#define IPC_CHK_AND_RET (   IPC_C,
  XRET,
  FUNC_STR 
)

#include <ipc/client/ipc_client.h>

Value:
do { \
xrt_result_t _ret = XRET; \
if (_ret != XRT_SUCCESS) { \
ipc_print_result((IPC_C)->imc.log_level, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
return _ret; \
} \
} while (false)

This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then returns XRET.

The argument IPC_C will be used to look up the cond_level for the ipc_print_result call.

Parameters
IPC_CClient connection, used to look up cond_level.
XRETThe xrt_result_t to check.
FUNC_STRString literal with the function name, used for logging.

◆ IPC_CHK_ONLY_PRINT

#define IPC_CHK_ONLY_PRINT (   IPC_C,
  XRET,
  FUNC_STR 
)

#include <ipc/client/ipc_client.h>

Value:
do { \
xrt_result_t _ret = XRET; \
if (_ret != XRT_SUCCESS) { \
ipc_print_result((IPC_C)->imc.log_level, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
} \
} while (false)

This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, it only prints and does nothing else.

The argument IPC_C will be used to look up the cond_level for the ipc_print_result call.

Parameters
IPC_CClient connection, used to look up cond_level.
XRETThe xrt_result_t to check.
FUNC_STRString literal with the function name, used for logging.

◆ IPC_CHK_WITH_GOTO

#define IPC_CHK_WITH_GOTO (   IPC_C,
  XRET,
  FUNC_STR,
  GOTO 
)

#include <ipc/client/ipc_client.h>

Value:
do { \
xrt_result_t _ret = XRET; \
if (_ret != XRT_SUCCESS) { \
ipc_print_result((IPC_C)->imc.log_level, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
goto GOTO; \
} \
} while (false)

This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then gotos GOTO.

The argument IPC_C will be used to look up the cond_level for the ipc_print_result call.

Parameters
IPC_CClient connection, used to look up cond_level.
XRETThe xrt_result_t to check.
FUNC_STRString literal with the function name, used for logging.
GOTOGoto label to jump to on error.

◆ IPC_CHK_WITH_RET

#define IPC_CHK_WITH_RET (   IPC_C,
  XRET,
  FUNC_STR,
  RET 
)

#include <ipc/client/ipc_client.h>

Value:
do { \
xrt_result_t _ret = XRET; \
if (_ret != XRT_SUCCESS) { \
ipc_print_result((IPC_C)->imc.log_level, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
return RET; \
} \
} while (false)

This define will error if XRET is not XRT_SUCCESS, printing out that the FUNC_STR string has failed, then returns RET.

The argument IPC_C will be used to look up the cond_level for the ipc_print_result call.

Parameters
IPC_CClient connection, used to look up cond_level.
XRETThe xrt_result_t to check.
FUNC_STRString literal with the function name, used for logging.
RETThe value that is returned on error.

Typedef Documentation

◆ ipc_client_device_t

#include <ipc/client/ipc_client_device.c>

An IPC client proxy for an controller or other non-MHD xrt_device and ipc_client_xdev.

Using a typedef reduce impact of refactor change.

◆ ipc_client_hmd_t

#include <ipc/client/ipc_client_hmd.c>

An IPC client proxy for an HMD xrt_device and ipc_client_xdev.

Using a typedef reduce impact of refactor change.

Function Documentation

◆ ipc_client_connection_fini()

void ipc_client_connection_fini ( struct ipc_connection ipc_c)

#include <ipc/client/ipc_client_connection.h>

Tear down the basics of the client connection: socket and shared mem.

Parameters
ipc_cinitialized IPC connection struct
Todo:
how to tear down the shared memory?

References ipc_message_channel::ipc_message_channel_close(), os_mutex::os_mutex_destroy(), and xrt_shmem_handle_t::XRT_SHMEM_HANDLE_INVALID.

Referenced by mnd_root_destroy().

◆ ipc_client_connection_init()

xrt_result_t ipc_client_connection_init ( struct ipc_connection ipc_c,
enum u_logging_level  log_level,
const struct xrt_instance_info i_info 
)

#include <ipc/client/ipc_client_connection.h>

Set up the basics of the client connection: socket and shared mem.

Parameters
ipc_cEmpty IPC connection struct
log_levelLog level for IPC messages
i_infoInstance info to send to server
Returns
XRT_SUCCESS on success

◆ ipc_client_connection_lock()

static void ipc_client_connection_lock ( struct ipc_connection ipc_c)
inlinestatic

#include <ipc/client/ipc_client_connection.h>

Locks the connection, allows sending complex messages.

Parameters
ipc_cThe IPC connection to lock.

References os_mutex::os_mutex_lock().

◆ ipc_client_connection_unlock()

static void ipc_client_connection_unlock ( struct ipc_connection ipc_c)
inlinestatic

#include <ipc/client/ipc_client_connection.h>

Unlocks the connection.

Parameters
ipc_cA locked IPC connection to unlock.

References os_mutex::os_mutex_unlock().

◆ ipc_client_xdev()

static struct ipc_client_xdev* ipc_client_xdev ( struct xrt_device xdev)
inlinestatic

#include <ipc/client/ipc_client.h>

Convenience helper to go from a xdev to ipc_client_xdev.

◆ ipc_instance_create()

xrt_result_t ipc_instance_create ( struct xrt_instance_info ii,
struct xrt_instance **  out_xinst 
)

#include <ipc/client/ipc_client_interface.h>

Create a IPC client instance, connects to a IPC server.

See also
ipc_design