Monado OpenXR Runtime
comp_multi_system.c File Reference

Multi client wrapper compositor. More...

#include "xrt/xrt_config_os.h"
#include "xrt/xrt_session.h"
#include "os/os_time.h"
#include "os/os_threading.h"
#include "util/u_var.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "util/u_wait.h"
#include "util/u_debug.h"
#include "util/u_trace_marker.h"
#include "util/u_distortion_mesh.h"
#include "util/u_linux.h"
#include "multi/comp_multi_private.h"
#include "multi/comp_multi_interface.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for comp_multi_system.c:

Functions

static void do_projection_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static void do_projection_layer_depth (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static bool do_single (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i, const char *name, struct xrt_device **out_xdev, struct xrt_swapchain **out_xcs, struct xrt_layer_data **out_data)
 
static void do_quad_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static void do_cube_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static void do_cylinder_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static void do_equirect1_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static void do_equirect2_layer (struct xrt_compositor *xc, struct multi_compositor *mc, struct multi_layer_entry *layer, uint32_t i)
 
static int overlay_sort_func (const void *a, const void *b)
 
static enum xrt_blend_mode find_active_blend_mode (struct multi_compositor **overlay_sorted_clients, size_t size)
 
static void transfer_layers_locked (struct multi_system_compositor *msc, int64_t display_time_ns, int64_t system_frame_id)
 
static void broadcast_timings_to_clients (struct multi_system_compositor *msc, int64_t predicted_display_time_ns)
 
static void broadcast_timings_to_pacers (struct multi_system_compositor *msc, int64_t predicted_display_time_ns, int64_t predicted_display_period_ns, int64_t diff_ns)
 
static void wait_frame (struct os_precise_sleeper *sleeper, struct xrt_compositor *xc, int64_t frame_id, int64_t wake_up_time_ns)
 
static void update_session_state_locked (struct multi_system_compositor *msc)
 
static int multi_main_loop (struct multi_system_compositor *msc)
 
static void * thread_func (void *ptr)
 
static xrt_result_t system_compositor_set_state (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible, bool focused)
 
static xrt_result_t system_compositor_set_z_order (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, int64_t z_order)
 
static xrt_result_t system_compositor_set_main_app_visibility (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible)
 
static xrt_result_t system_compositor_notify_loss_pending (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, int64_t loss_time_ns)
 
static xrt_result_t system_compositor_notify_lost (struct xrt_system_compositor *xsc, struct xrt_compositor *xc)
 
static xrt_result_t system_compositor_notify_display_refresh_changed (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, float from_display_refresh_rate_hz, float to_display_refresh_rate_hz)
 
static xrt_result_t system_compositor_create_native_compositor (struct xrt_system_compositor *xsc, const struct xrt_session_info *xsi, struct xrt_session_event_sink *xses, struct xrt_compositor_native **out_xcn)
 
static void system_compositor_destroy (struct xrt_system_compositor *xsc)
 
void multi_system_compositor_update_session_status (struct multi_system_compositor *msc, bool active)
 
xrt_result_t comp_multi_create_system_compositor (struct xrt_compositor_native *xcn, struct u_pacing_app_factory *upaf, const struct xrt_system_compositor_info *xsci, bool do_warm_start, struct xrt_system_compositor **out_xsysc)
 

Detailed Description

Function Documentation

◆ comp_multi_create_system_compositor()

xrt_result_t comp_multi_create_system_compositor ( struct xrt_compositor_native xcn,
struct u_pacing_app_factory upaf,
const struct xrt_system_compositor_info xsci,
bool  do_warm_start,
struct xrt_system_compositor **  out_xsysc 
)
Todo:
Make the clients not go from IDLE to READY before we have completed a first frame.

◆ system_compositor_set_state()

static xrt_result_t system_compositor_set_state ( struct xrt_system_compositor xsc,
struct xrt_compositor xc,
bool  visible,
bool  focused 
)
static

◆ system_compositor_set_z_order()

static xrt_result_t system_compositor_set_z_order ( struct xrt_system_compositor xsc,
struct xrt_compositor xc,
int64_t  z_order 
)
static

◆ update_session_state_locked()

static void update_session_state_locked ( struct multi_system_compositor msc)
static
Todo:
Make this not be hardcoded.

References xrt_compositor_native::base, and multi_system_compositor::xcn.