Monado OpenXR Runtime
ipc_server.h File Reference

Common server side code. More...

#include "xrt/xrt_compiler.h"
#include "xrt/xrt_system.h"
#include "xrt/xrt_space.h"
#include "os/os_threading.h"
#include "util/u_logging.h"
#include "shared/ipc_protocol.h"
#include "shared/ipc_message_channel.h"
#include <stdio.h>
Include dependency graph for ipc_server.h:

Go to the source code of this file.

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_thread
 
struct  ipc_device
 
struct  ipc_server_mainloop
 Platform-specific mainloop object for the IPC server. More...
 
struct  ipc_server
 Main IPC object for the server. More...
 

Macros

#define IPC_TRACE(d, ...)   U_LOG_IFL_T(d->log_level, __VA_ARGS__)
 
#define IPC_DEBUG(d, ...)   U_LOG_IFL_D(d->log_level, __VA_ARGS__)
 
#define IPC_INFO(d, ...)   U_LOG_IFL_I(d->log_level, __VA_ARGS__)
 
#define IPC_WARN(d, ...)   U_LOG_IFL_W(d->log_level, __VA_ARGS__)
 
#define IPC_ERROR(d, ...)   U_LOG_IFL_E(d->log_level, __VA_ARGS__)
 
#define IPC_MAX_CLIENT_SEMAPHORES   8
 
#define IPC_MAX_CLIENT_SWAPCHAINS   32
 
#define IPC_MAX_CLIENT_SPACES   128
 
#define XRT_IPC_GOT_IMPL
 
#define XRT_IPC_GOT_IMPL
 
#define XRT_IPC_GOT_IMPL
 

Enumerations

enum  ipc_thread_state { IPC_THREAD_READY , IPC_THREAD_STARTING , IPC_THREAD_RUNNING , IPC_THREAD_STOPPING }
 

Functions

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. More...
 
xrt_result_t ipc_server_set_active_client (struct ipc_server *s, uint32_t client_id)
 Set the new active client. More...
 
xrt_result_t ipc_server_toggle_io_client (struct ipc_server *s, uint32_t client_id)
 Toggle the io for this client. More...
 
void ipc_server_activate_session (volatile struct ipc_client_state *ics)
 Called by client threads to set a session to active. More...
 
void ipc_server_deactivate_session (volatile struct ipc_client_state *ics)
 Called by client threads to set a session to deactivate. More...
 
void ipc_server_update_state (struct ipc_server *s)
 Called by client threads to recalculate active client. More...
 
void * ipc_server_client_thread (void *_ics)
 Thread function for the client side dispatching. More...
 
void ipc_server_client_destroy_session_and_compositor (volatile struct ipc_client_state *ics)
 This destroys the native compositor for this client and any extra objects created from it, like all of the swapchains. More...
 
xrt_result_t ipc_server_get_system_properties (struct ipc_server *vs, struct xrt_system_properties *out_properties)
 
static struct xrt_deviceget_xdev (volatile struct ipc_client_state *ics, uint32_t device_id)
 Get a xdev with the given device_id. More...
 
static struct ipc_deviceget_idev (volatile struct ipc_client_state *ics, uint32_t device_id)
 Get a idev with the given device_id. More...
 

Detailed Description

Function Documentation

◆ get_idev()

static struct ipc_device* get_idev ( volatile struct ipc_client_state ics,
uint32_t  device_id 
)
inlinestatic

Get a idev with the given device_id.

References ipc_client_state::server.

◆ get_xdev()

static struct xrt_device* get_xdev ( volatile struct ipc_client_state ics,
uint32_t  device_id 
)
inlinestatic

Get a xdev with the given device_id.

References ipc_client_state::server, and ipc_device::xdev.

◆ ipc_server_client_destroy_session_and_compositor()

void ipc_server_client_destroy_session_and_compositor ( volatile struct ipc_client_state ics)

This destroys the native compositor for this client and any extra objects created from it, like all of the swapchains.

References os_mutex::os_mutex_lock(), ipc_client_state::server, and ipc_client_state::swapchain_count.