33#define MULTI_MAX_CLIENTS 64
41#define MULTI_MAX_LAYERS XRT_MAX_LAYERS
188 float current_refresh_rate_hz;
231multi_compositor_deliver_any_frames(
struct multi_compositor *mc, int64_t display_time_ns);
241multi_compositor_latch_frame_locked(
struct multi_compositor *mc, int64_t when_ns, int64_t system_frame_id);
251multi_compositor_retire_delivered_locked(
struct multi_compositor *mc, int64_t when_ns);
364 int64_t predicted_display_time_ns;
365 int64_t predicted_display_period_ns;
static struct multi_compositor * multi_compositor(struct xrt_compositor *xc)
Small helper go from xrt_compositor to multi_compositor.
Definition: comp_multi_private.h:197
#define MULTI_MAX_LAYERS
Number of max active layers per multi_compositor.
Definition: comp_multi_private.h:41
xrt_result_t multi_compositor_create(struct multi_system_compositor *msc, const struct xrt_session_info *xsi, struct xrt_session_event_sink *xses, struct xrt_compositor_native **out_xcn)
Create a multi client wrapper compositor.
Definition: comp_multi_compositor.c:964
#define MULTI_MAX_CLIENTS
Number of max active clients.
Definition: comp_multi_private.h:33
multi_system_state
State of the multi-client system compositor.
Definition: comp_multi_private.h:269
@ MULTI_SYSTEM_STATE_INVALID
Invalid state, never used.
Definition: comp_multi_private.h:273
@ MULTI_SYSTEM_STATE_RUNNING
The main session is running.
Definition: comp_multi_private.h:297
@ MULTI_SYSTEM_STATE_STOPPING
There are no active sessions and the multi-client system compositor is instructing the native composi...
Definition: comp_multi_private.h:306
@ MULTI_SYSTEM_STATE_INIT_WARM_START
One of the initial states, the multi-client system compositor will make sure that its xrt_compositor_...
Definition: comp_multi_private.h:281
@ MULTI_SYSTEM_STATE_STOPPED
One of the initial state and post stopping state.
Definition: comp_multi_private.h:289
enum xrt_result xrt_result_t
Result type used across Monado.
Wrapper around OS threading native functions.
Wrapper around OS native time functions.
A single compositor for feeding the layers from one session/app into the multi-client-capable system ...
Definition: comp_multi_private.h:103
struct multi_layer_slot scheduled
Scheduled frames for a future timepoint.
Definition: comp_multi_private.h:178
struct os_precise_sleeper scheduled_sleeper
Used when waiting for the scheduled frame to complete.
Definition: comp_multi_private.h:119
struct multi_system_compositor * msc
Owning system compositor.
Definition: comp_multi_private.h:113
uint64_t value
Timeline semaphore value to wait for.
Definition: comp_multi_private.h:140
int64_t slot_next_frame_display
The next which the next frames to be picked up will be displayed.
Definition: comp_multi_private.h:169
struct xrt_session_event_sink * xses
Where events for this compositor should go.
Definition: comp_multi_private.h:110
struct xrt_compositor_semaphore * xcsem
Timeline semaphore to wait for.
Definition: comp_multi_private.h:137
struct os_mutex slot_lock
Lock for all of the slots.
Definition: comp_multi_private.h:164
struct os_thread_helper oth
The wait thread itself.
Definition: comp_multi_private.h:146
int64_t frame_id
Frame id of frame being waited on.
Definition: comp_multi_private.h:143
bool blocked
Is the client thread blocked?
Definition: comp_multi_private.h:160
struct multi_layer_slot delivered
Fully ready to be used.
Definition: comp_multi_private.h:184
struct os_precise_sleeper frame_sleeper
Used to implement wait frame, only used for in process.
Definition: comp_multi_private.h:116
struct xrt_compositor_fence * xcf
Fence to wait for.
Definition: comp_multi_private.h:134
bool alive
Have we gotten to the loop?
Definition: comp_multi_private.h:149
bool waiting
Is the thread waiting, if so the client should block.
Definition: comp_multi_private.h:152
struct multi_layer_slot progress
Currently being transferred or waited on.
Definition: comp_multi_private.h:175
Data for a single composition layer.
Definition: comp_multi_private.h:58
struct xrt_layer_data data
All basic (trivially-serializable) data associated with a layer, aside from which swapchain(s) are us...
Definition: comp_multi_private.h:75
struct xrt_swapchain * xscs[2 *XRT_MAX_VIEWS]
Pointers to swapchains.
Definition: comp_multi_private.h:69
struct xrt_device * xdev
Device to get pose from.
Definition: comp_multi_private.h:62
Render state for a single client, including all layers.
Definition: comp_multi_private.h:84
The multi-client module (aka multi compositor) is system compositor that multiplexes access to a sing...
Definition: comp_multi_private.h:320
struct xrt_multi_compositor_control xmcc
Extra functions to handle multi client.
Definition: comp_multi_private.h:325
struct multi_compositor * clients[64]
List of active clients.
Definition: comp_multi_private.h:370
enum multi_system_state state
The state of the multi-client system compositor.
Definition: comp_multi_private.h:350
struct os_thread_helper oth
Render loop thread.
Definition: comp_multi_private.h:340
struct u_pacing_app_factory * upaf
App pacer factory, when a new multi_compositor is created a pacer is created from this factory.
Definition: comp_multi_private.h:337
struct os_mutex list_and_timing_lock
This mutex protects the list of client compositor and the rendering timings on it.
Definition: comp_multi_private.h:360
uint64_t active_count
Number of active sessions, protected by oth.
Definition: comp_multi_private.h:353
struct xrt_compositor_native * xcn
Real native compositor, which this multi client module submits the combined layers of active multi_co...
Definition: comp_multi_private.h:331
struct xrt_system_compositor base
Base interface.
Definition: comp_multi_private.h:322
A wrapper around a native mutex.
Definition: os_threading.h:55
Definition: os_time.h:208
All in one helper that handles locking, waiting for change and starting a thread.
Definition: os_threading.h:453
Small helper that creates a app pacers, allows timing information to be collected and controlled to a...
Definition: u_pacing.h:619
This application pacing helper is designed to schedule the rendering time of clients that submit fram...
Definition: u_pacing.h:348
Compositor fence used for synchronization.
Definition: xrt_compositor.h:731
Main compositor server interface.
Definition: xrt_compositor.h:2224
struct xrt_compositor base
Base.
Definition: xrt_compositor.h:2226
Compositor semaphore used for synchronization, needs to be as capable as a Vulkan pipeline semaphore.
Definition: xrt_compositor.h:788
Common compositor client interface/base.
Definition: xrt_compositor.h:988
A single HMD or input device.
Definition: xrt_device.h:241
All the pure data values associated with a composition layer.
Definition: xrt_compositor.h:394
Per frame data for the layer submission calls, used in xrt_compositor::layer_begin.
Definition: xrt_compositor.h:478
Special functions to control multi session/clients.
Definition: xrt_compositor.h:2353
Used internally from producers of events to push events into session, some sinks might multiplex even...
Definition: xrt_session.h:206
Session information, mostly overlay extension data.
Definition: xrt_compositor.h:930
Common swapchain interface/base.
Definition: xrt_compositor.h:536
The system compositor handles composition for a system.
Definition: xrt_compositor.h:2414
Union of all session events, used to return multiple events through one call.
Definition: xrt_session.h:186
Header holding common defines.
Header declaring XRT graphics interfaces.
Common defines and enums for XRT.
Header for limits of the XRT interfaces.