Monado OpenXR Runtime
comp_multi_private.h File Reference

System compositor capable of supporting multiple clients: internal structs. More...

#include "xrt/xrt_compiler.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_compositor.h"
#include "os/os_time.h"
#include "os/os_threading.h"
#include "util/u_pacing.h"
Include dependency graph for comp_multi_private.h:

Go to the source code of this file.

Data Structures

struct  multi_layer_entry
 Data for a single composition layer. More...
 
struct  multi_layer_slot
 Render state for a single client, including all layers. More...
 
struct  multi_compositor
 A single compositor for feeding the layers from one session/app into the multi-client-capable system compositor. More...
 
struct  multi_system_compositor
 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...
 

Macros

#define MULTI_MAX_CLIENTS   64
 Number of max active clients. More...
 
#define MULTI_MAX_LAYERS   16
 Number of max active layers per multi_compositor. More...
 

Enumerations

enum  multi_system_state {
  MULTI_SYSTEM_STATE_INVALID , MULTI_SYSTEM_STATE_INIT_WARM_START , MULTI_SYSTEM_STATE_STOPPED , MULTI_SYSTEM_STATE_RUNNING ,
  MULTI_SYSTEM_STATE_STOPPING
}
 State of the multi-client system compositor. More...
 

Functions

static struct multi_compositormulti_compositor (struct xrt_compositor *xc)
 Small helper go from xrt_compositor to multi_compositor. More...
 
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. More...
 

Detailed Description

System compositor capable of supporting multiple clients: internal structs.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ MULTI_MAX_CLIENTS

#define MULTI_MAX_CLIENTS   64

Number of max active clients.

Todo:
Move to xrt_limits.h, or make dynamic to remove limit.

◆ MULTI_MAX_LAYERS

#define MULTI_MAX_LAYERS   16

Number of max active layers per multi_compositor.

Todo:
Move to xrt_limits.h and share.

Enumeration Type Documentation

◆ multi_system_state

State of the multi-client system compositor.

Use to track the calling of native compositor methods xrt_comp_begin_session and xrt_comp_end_session.

It is driven by the number of active app sessions.

Enumerator
MULTI_SYSTEM_STATE_INVALID 

Invalid state, never used.

MULTI_SYSTEM_STATE_INIT_WARM_START 

One of the initial states, the multi-client system compositor will make sure that its xrt_compositor_native submits one frame.

The session hasn't been started yet.

MULTI_SYSTEM_STATE_STOPPED 

One of the initial state and post stopping state.

The multi-client system compositor has called xrt_comp_end_session on its xrt_compositor_native.

MULTI_SYSTEM_STATE_RUNNING 

The main session is running.

The multi-client system compositor has called xrt_comp_begin_session on its xrt_compositor_native.

MULTI_SYSTEM_STATE_STOPPING 

There are no active sessions and the multi-client system compositor is instructing the native compositor to draw one or more clear frames.

The multi-client system compositor has not yet called xrt_comp_begin_session on its xrt_compositor_native.

Function Documentation

◆ multi_compositor()

static struct multi_compositor* multi_compositor ( struct xrt_compositor xc)
inlinestatic

◆ multi_compositor_create()

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.