Monado OpenXR Runtime
Loading...
Searching...
No Matches
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.
 

Data Fields

struct xrt_system_compositor base
 Base interface.
 
struct xrt_multi_compositor_control xmcc
 Extra functions to handle multi client.
 
struct xrt_compositor_nativexcn
 Real native compositor, which this multi client module submits the combined layers of active multi_compositor objects.
 
struct u_pacing_app_factoryupaf
 App pacer factory, when a new multi_compositor is created a pacer is created from this factory.
 
struct os_thread_helper oth
 Render loop thread.
 
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.
 
struct { 
 
   int64_t   predicted_display_time_ns 
 
   int64_t   predicted_display_period_ns 
 
   int64_t   diff_ns 
 
last_timings 
 
struct multi_compositorclients [64]
 List of active clients.
 
- Data Fields inherited from xrt_system_compositor
struct xrt_multi_compositor_controlxmcc
 An optional aspect/additional interface, providing multi-app control.
 
struct xrt_system_compositor_info info
 Info regarding the system.
 
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.
 
void(* destroy )(struct xrt_system_compositor *xsc)
 Teardown the system compositor.
 

Additional Inherited Members

- Static Public Member Functions inherited from xrt_system_compositor
static XRT_NONNULL_ALL xrt_result_t xrt_syscomp_set_state (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible, bool focused, int64_t timestamp_ns)
 Sets the state of the compositor, generating any events to the client if the state is actually changed.
 
static XRT_NONNULL_ALL 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.
 
static XRT_NONNULL_ALL 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.
 
static XRT_NONNULL_ALL xrt_result_t xrt_syscomp_notify_loss_pending (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, int64_t loss_time_ns)
 Notify this client/session if the compositor is going to lose the ability of rendering.
 
static XRT_NONNULL_ALL 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.
 
static XRT_NONNULL_ALL 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.
 
static XRT_NONNULL_ALL 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.
 
static XRT_NONNULL_ALL void xrt_syscomp_destroy (struct xrt_system_compositor **xsc_ptr)
 Teardown the system compositor.
 

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 active_count, base, xrt_system_compositor::create_native_compositor, xrt_system_compositor::destroy, xrt_system_compositor::info, list_and_timing_lock, MULTI_SYSTEM_STATE_INIT_WARM_START, MULTI_SYSTEM_STATE_STOPPED, xrt_multi_compositor_control::notify_display_refresh_changed, xrt_multi_compositor_control::notify_loss_pending, xrt_multi_compositor_control::notify_lost, os_monotonic_get_ns(), oth, xrt_multi_compositor_control::set_main_app_visibility, xrt_multi_compositor_control::set_state, xrt_multi_compositor_control::set_z_order, state, system_compositor_set_state(), system_compositor_set_z_order(), U_TIME_1MS_IN_NS, U_TYPED_CALLOC, upaf, xcn, xmcc, xrt_system_compositor::xmcc, XRT_ERROR_THREADING_INIT_FAILURE, and XRT_SUCCESS.

Field Documentation

◆ active_count

uint64_t multi_system_compositor::active_count

Number of active sessions, protected by oth.

Referenced by comp_multi_create_system_compositor(), and update_session_state_locked().

◆ 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.

Referenced by multi_compositor_create().

◆ 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.

Referenced by comp_multi_create_system_compositor(), multi_compositor_create(), and multi_compositor_layer_commit().

◆ oth

struct os_thread_helper multi_system_compositor::oth

Render loop thread.

Referenced by comp_multi_create_system_compositor().

◆ 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.

Referenced by comp_multi_create_system_compositor(), and update_session_state_locked().

◆ 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.

Referenced by comp_multi_create_system_compositor(), and multi_compositor_create().

◆ 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 comp_multi_create_system_compositor(), multi_compositor_create(), multi_compositor_layer_commit(), and update_session_state_locked().

◆ xmcc

struct xrt_multi_compositor_control multi_system_compositor::xmcc

Extra functions to handle multi client.

Referenced by comp_multi_create_system_compositor().


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