diff --git a/src/xrt/ipc/client/ipc_client_compositor.c b/src/xrt/ipc/client/ipc_client_compositor.c index a82e4ddca..c8a696132 100644 --- a/src/xrt/ipc/client/ipc_client_compositor.c +++ b/src/xrt/ipc/client/ipc_client_compositor.c @@ -772,6 +772,16 @@ ipc_compositor_discard_frame(struct xrt_compositor *xc, int64_t frame_id) 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 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.destroy = ipc_compositor_destroy; icc->base.base.poll_events = ipc_compositor_poll_events; + icc->base.base.set_thread_hint = ipc_compositor_set_thread_hint; // Using in wait frame. os_precise_sleeper_init(&icc->sleeper); diff --git a/src/xrt/ipc/server/ipc_server_handler.c b/src/xrt/ipc/server/ipc_server_handler.c index 24e30a350..352da2868 100644 --- a/src/xrt/ipc/server/ipc_server_handler.c +++ b/src/xrt/ipc/server/ipc_server_handler.c @@ -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); } +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 ipc_handle_system_get_clients(volatile struct ipc_client_state *_ics, struct ipc_client_list *list) { diff --git a/src/xrt/ipc/shared/proto.json b/src/xrt/ipc/shared/proto.json index 43d3c0411..dbc68ef7c 100644 --- a/src/xrt/ipc/shared/proto.json +++ b/src/xrt/ipc/shared/proto.json @@ -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": { "in": [ {"name": "info", "type": "struct xrt_swapchain_create_info"}