mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
ipc: Add support for thread hint function
This commit is contained in:
parent
faec524709
commit
81a094f990
|
@ -772,6 +772,16 @@ ipc_compositor_discard_frame(struct xrt_compositor *xc, int64_t frame_id)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static xrt_result_t
|
||||||
|
ipc_compositor_set_thread_hint(struct xrt_compositor *xc, enum xrt_thread_hint hint, uint32_t thread_id)
|
||||||
|
{
|
||||||
|
struct ipc_client_compositor *icc = ipc_client_compositor(xc);
|
||||||
|
|
||||||
|
IPC_CALL_CHK(ipc_call_compositor_set_thread_hint(icc->ipc_c, hint, thread_id));
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ipc_compositor_destroy(struct xrt_compositor *xc)
|
ipc_compositor_destroy(struct xrt_compositor *xc)
|
||||||
{
|
{
|
||||||
|
@ -810,6 +820,7 @@ ipc_compositor_init(struct ipc_client_compositor *icc, struct xrt_compositor_nat
|
||||||
icc->base.base.layer_commit_with_semaphore = ipc_compositor_layer_commit_with_semaphore;
|
icc->base.base.layer_commit_with_semaphore = ipc_compositor_layer_commit_with_semaphore;
|
||||||
icc->base.base.destroy = ipc_compositor_destroy;
|
icc->base.base.destroy = ipc_compositor_destroy;
|
||||||
icc->base.base.poll_events = ipc_compositor_poll_events;
|
icc->base.base.poll_events = ipc_compositor_poll_events;
|
||||||
|
icc->base.base.set_thread_hint = ipc_compositor_set_thread_hint;
|
||||||
|
|
||||||
// Using in wait frame.
|
// Using in wait frame.
|
||||||
os_precise_sleeper_init(&icc->sleeper);
|
os_precise_sleeper_init(&icc->sleeper);
|
||||||
|
|
|
@ -937,6 +937,21 @@ ipc_handle_compositor_poll_events(volatile struct ipc_client_state *ics, union x
|
||||||
return xrt_comp_poll_events(ics->xc, out_xce);
|
return xrt_comp_poll_events(ics->xc, out_xce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xrt_result_t
|
||||||
|
ipc_handle_compositor_set_thread_hint(volatile struct ipc_client_state *ics,
|
||||||
|
enum xrt_thread_hint hint,
|
||||||
|
uint32_t thread_id)
|
||||||
|
|
||||||
|
{
|
||||||
|
IPC_TRACE_MARKER();
|
||||||
|
|
||||||
|
if (ics->xc == NULL) {
|
||||||
|
return XRT_ERROR_IPC_SESSION_NOT_CREATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return xrt_comp_set_thread_hint(ics->xc, hint, thread_id);
|
||||||
|
}
|
||||||
|
|
||||||
xrt_result_t
|
xrt_result_t
|
||||||
ipc_handle_system_get_clients(volatile struct ipc_client_state *_ics, struct ipc_client_list *list)
|
ipc_handle_system_get_clients(volatile struct ipc_client_state *_ics, struct ipc_client_list *list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -189,6 +189,13 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"compositor_set_thread_hint": {
|
||||||
|
"in": [
|
||||||
|
{"name": "hint", "type": "enum xrt_thread_hint"},
|
||||||
|
{"name": "thread_id", "type": "uint32_t"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"swapchain_get_properties": {
|
"swapchain_get_properties": {
|
||||||
"in": [
|
"in": [
|
||||||
{"name": "info", "type": "struct xrt_swapchain_create_info"}
|
{"name": "info", "type": "struct xrt_swapchain_create_info"}
|
||||||
|
|
Loading…
Reference in a new issue