Monado OpenXR Runtime
|
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>
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... | |
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_native * | xcn |
Real native compositor, which this multi client module submits the combined layers of active multi_compositor objects. More... | |
struct u_pacing_app_factory * | upaf |
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 { | |
int64_t predicted_display_time_ns | |
int64_t predicted_display_period_ns | |
int64_t diff_ns | |
} | last_timings |
struct multi_compositor * | clients [64] |
List of active clients. More... | |
Data Fields inherited from xrt_system_compositor | |
struct xrt_multi_compositor_control * | xmcc |
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 | |
Static 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, int64_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... | |
Related Functions inherited from xrt_system_compositor | |
xrt_result_t | comp_main_create_system_compositor (struct xrt_device *xdev, const struct comp_target_factory *ctf, struct xrt_system_compositor **out_xsysc) |
Creates the main compositor, it doesn't return itself but instead wraps itself with a system compositor. More... | |
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.
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.
xcn | Native compositor that client are multi-plexed to. |
upaf | App pacing factory, one pacer created per client. |
xsci | Information to be exposed. |
do_warm_start | Should we always submit a frame at startup. |
out_xsysc | Created xrt_system_compositor. |
References base, xrt_system_compositor::create_native_compositor, and U_TYPED_CALLOC.
uint64_t multi_system_compositor::active_count |
Number of active sessions, protected by oth.
struct xrt_system_compositor multi_system_compositor::base |
Base interface.
Referenced by comp_multi_create_system_compositor().
struct multi_compositor* multi_system_compositor::clients[64] |
List of active clients.
struct os_mutex multi_system_compositor::list_and_timing_lock |
This mutex protects the list of client compositor and the rendering timings on it.
struct os_thread_helper multi_system_compositor::oth |
Render loop thread.
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.
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.
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().
struct xrt_multi_compositor_control multi_system_compositor::xmcc |
Extra functions to handle multi client.