c/multi: Pass in option to do warm start-ups

This commit is contained in:
Jakob Bornecrantz 2022-09-14 00:41:27 +01:00 committed by Moses Turner
parent 6faea9224e
commit e06608533f
5 changed files with 12 additions and 4 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}