diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c index eec53114a..fc0546be8 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c @@ -1305,5 +1305,5 @@ xrt_gfx_provider_create_system(struct xrt_device *xdev, struct xrt_system_compos xrt_result_t xret = u_pa_factory_create(&upaf); assert(xret == XRT_SUCCESS && upaf != NULL); - return comp_multi_create_system_compositor(&c->base.base, upaf, sys_info, out_xsysc); + return comp_multi_create_system_compositor(&c->base.base, upaf, sys_info, true, out_xsysc); } diff --git a/src/xrt/compositor/multi/comp_multi_interface.h b/src/xrt/compositor/multi/comp_multi_interface.h index 1f5faa23b..13e3fb734 100644 --- a/src/xrt/compositor/multi/comp_multi_interface.h +++ b/src/xrt/compositor/multi/comp_multi_interface.h @@ -24,11 +24,18 @@ struct u_pacing_app_factory; * 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. + * + * @param xcn Native compositor that client are multi-plexed to. + * @param upaf App pacing factory, one pacer created per client. + * @param xsci Information to be exposed. + * @param do_warm_start Should we always submit a frame at startup. + * @param out_xsysc Created @ref xrt_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); diff --git a/src/xrt/compositor/multi/comp_multi_system.c b/src/xrt/compositor/multi/comp_multi_system.c index db6bffd93..8fc92d984 100644 --- a/src/xrt/compositor/multi/comp_multi_system.c +++ b/src/xrt/compositor/multi/comp_multi_system.c @@ -642,6 +642,7 @@ 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) { struct multi_system_compositor *msc = U_TYPED_CALLOC(struct multi_system_compositor); @@ -654,8 +655,8 @@ comp_multi_create_system_compositor(struct xrt_compositor_native *xcn, msc->base.info = *xsci; msc->upaf = upaf; msc->xcn = xcn; - msc->sessions.state = MULTI_SYSTEM_STATE_STOPPED; msc->sessions.active_count = 0; + msc->sessions.state = do_warm_start ? MULTI_SYSTEM_STATE_INIT_WARM_START : MULTI_SYSTEM_STATE_STOPPED; os_mutex_init(&msc->list_and_timing_lock); diff --git a/src/xrt/compositor/null/null_compositor.c b/src/xrt/compositor/null/null_compositor.c index 563ca7423..8fe244137 100644 --- a/src/xrt/compositor/null/null_compositor.c +++ b/src/xrt/compositor/null/null_compositor.c @@ -589,5 +589,5 @@ null_compositor_create_system(struct xrt_device *xdev, struct xrt_system_composi xrt_result_t xret = u_pa_factory_create(&upaf); assert(xret == XRT_SUCCESS && upaf != NULL); - return comp_multi_create_system_compositor(&c->base.base, upaf, &c->sys_info, out_xsysc); + return comp_multi_create_system_compositor(&c->base.base, upaf, &c->sys_info, false, out_xsysc); } diff --git a/src/xrt/targets/sdl_test/sdl_compositor.c b/src/xrt/targets/sdl_test/sdl_compositor.c index 9eefc843a..3b323a3d5 100644 --- a/src/xrt/targets/sdl_test/sdl_compositor.c +++ b/src/xrt/targets/sdl_test/sdl_compositor.c @@ -604,5 +604,5 @@ sdl_compositor_create_system(struct sdl_program *sp, struct xrt_system_composito xrt_result_t xret = u_pa_factory_create(&upaf); assert(xret == XRT_SUCCESS && upaf != NULL); - return comp_multi_create_system_compositor(&sp->c.base.base, upaf, &sp->c.sys_info, out_xsysc); + return comp_multi_create_system_compositor(&sp->c.base.base, upaf, &sp->c.sys_info, false, out_xsysc); }