Monado OpenXR Runtime
multi_system_compositor Struct Reference

The multi-client module (aka multi compositor) is system compositor that multiplexes access to a single xrt_compositor_native, merging layers from one or more client apps/sessions. More...

#include <multi/comp_multi_private.h>

Inheritance diagram for multi_system_compositor:
Collaboration diagram for multi_system_compositor:

Public Member Functions

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)
 Create a "system compositor" that can handle multiple clients (each through a "multi compositor") and that drives a single native compositor. More...
 
- Public Member Functions inherited from xrt_system_compositor
static xrt_result_t xrt_syscomp_set_state (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible, bool focused)
 Sets the state of the compositor, generating any events to the client if the state is actually changed. More...
 
static xrt_result_t xrt_syscomp_set_z_order (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, int64_t z_order)
 Set the rendering Z order for rendering, visible has higher priority then z_order but is still saved until visible again. More...
 
static xrt_result_t xrt_syscomp_set_main_app_visibility (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible)
 Tell this client/session if the main application is visible or not. More...
 
static xrt_result_t xrt_syscomp_notify_loss_pending (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, uint64_t loss_time_ns)
 Notify this client/session if the compositor is going to lose the ability of rendering. More...
 
static xrt_result_t xrt_syscomp_notify_lost (struct xrt_system_compositor *xsc, struct xrt_compositor *xc)
 Notify this client/session if the compositor lost the ability of rendering. More...
 
static xrt_result_t xrt_syscomp_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)
 Notify this client/session if the display refresh rate has been changed. More...
 
static xrt_result_t xrt_syscomp_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)
 Create a new native compositor. More...
 
static void xrt_syscomp_destroy (struct xrt_system_compositor **xsc_ptr)
 Teardown the system compositor. More...
 

Data Fields

struct xrt_system_compositor base
 Base interface. More...
 
struct xrt_multi_compositor_control xmcc
 Extra functions to handle multi client. More...
 
struct xrt_compositor_nativexcn
 Real native compositor, which this multi client module submits the combined layers of active multi_compositor objects. More...
 
struct u_pacing_app_factoryupaf
 App pacer factory, when a new multi_compositor is created a pacer is created from this factory. More...
 
struct os_thread_helper oth
 Render loop thread. More...
 
struct {
   enum multi_system_state   state
 The state of the multi-client system compositor. More...
 
   uint64_t   active_count
 Number of active sessions, protected by oth. More...
 
sessions
 
struct os_mutex list_and_timing_lock
 This mutex protects the list of client compositor and the rendering timings on it. More...
 
struct {
   uint64_t   predicted_display_time_ns
 
   uint64_t   predicted_display_period_ns
 
   uint64_t   diff_ns
 
last_timings
 
struct multi_compositorclients [64]
 List of active clients. More...
 
- Data Fields inherited from xrt_system_compositor
struct xrt_multi_compositor_controlxmcc
 An optional aspect/additional interface, providing multi-app control. More...
 
struct xrt_system_compositor_info info
 Info regarding the system. More...
 
xrt_result_t(* 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)
 Create a new native compositor. More...
 
void(* destroy )(struct xrt_system_compositor *xsc)
 Teardown the system compositor. More...
 

Additional Inherited Members

Detailed Description

The multi-client module (aka multi compositor) is system compositor that multiplexes access to a single xrt_compositor_native, merging layers from one or more client apps/sessions.

This object implements the xrt_system_compositor, and gives each session a multi_compositor, which implements xrt_compositor_native.

Member 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 
)

Create a "system compositor" that can handle multiple clients (each through a "multi compositor") and that drives a single native compositor.

Both the native compositor and the pacing factory is owned by the system compositor and destroyed by it.

Parameters
xcnNative compositor that client are multi-plexed to.
upafApp pacing factory, one pacer created per client.
xsciInformation to be exposed.
do_warm_startShould we always submit a frame at startup.
out_xsyscCreated xrt_system_compositor.

References base, xrt_system_compositor::create_native_compositor, and U_TYPED_CALLOC.

Field Documentation

◆ active_count

uint64_t multi_system_compositor::active_count

Number of active sessions, protected by oth.

◆ base

struct xrt_system_compositor multi_system_compositor::base

Base interface.

Referenced by comp_multi_create_system_compositor().

◆ clients

struct multi_compositor* multi_system_compositor::clients[64]

List of active clients.

◆ list_and_timing_lock

struct os_mutex multi_system_compositor::list_and_timing_lock

This mutex protects the list of client compositor and the rendering timings on it.

◆ oth

struct os_thread_helper multi_system_compositor::oth

Render loop thread.

◆ state

enum multi_system_state multi_system_compositor::state

The state of the multi-client system compositor.

This is updated on the multi_system_compositor::oth thread, aka multi-client system compositor main thread. It is driven by the active_count field.

◆ upaf

struct u_pacing_app_factory* multi_system_compositor::upaf

App pacer factory, when a new multi_compositor is created a pacer is created from this factory.

◆ xcn

struct xrt_compositor_native* multi_system_compositor::xcn

Real native compositor, which this multi client module submits the combined layers of active multi_compositor objects.

Referenced by update_session_state_locked().

◆ xmcc

struct xrt_multi_compositor_control multi_system_compositor::xmcc

Extra functions to handle multi client.


The documentation for this struct was generated from the following files: