mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
ipc: Implement display refresh rate functions
This commit is contained in:
parent
df07128590
commit
74df016dbf
|
@ -792,6 +792,26 @@ ipc_compositor_set_thread_hint(struct xrt_compositor *xc, enum xrt_thread_hint h
|
|||
IPC_CHK_ALWAYS_RET(icc->ipc_c, xret, "ipc_call_compositor_set_thread_hint");
|
||||
}
|
||||
|
||||
static xrt_result_t
|
||||
ipc_compositor_get_display_refresh_rate(struct xrt_compositor *xc, float *out_display_refresh_rate_hz)
|
||||
{
|
||||
struct ipc_client_compositor *icc = ipc_client_compositor(xc);
|
||||
xrt_result_t xret;
|
||||
|
||||
xret = ipc_call_compositor_get_display_refresh_rate(icc->ipc_c, out_display_refresh_rate_hz);
|
||||
IPC_CHK_ALWAYS_RET(icc->ipc_c, xret, "ipc_call_compositor_get_display_refresh_rate");
|
||||
}
|
||||
|
||||
static xrt_result_t
|
||||
ipc_compositor_request_display_refresh_rate(struct xrt_compositor *xc, float display_refresh_rate_hz)
|
||||
{
|
||||
struct ipc_client_compositor *icc = ipc_client_compositor(xc);
|
||||
xrt_result_t xret;
|
||||
|
||||
xret = ipc_call_compositor_request_display_refresh_rate(icc->ipc_c, display_refresh_rate_hz);
|
||||
IPC_CHK_ALWAYS_RET(icc->ipc_c, xret, "ipc_call_compositor_request_display_refresh_rate");
|
||||
}
|
||||
|
||||
static void
|
||||
ipc_compositor_destroy(struct xrt_compositor *xc)
|
||||
{
|
||||
|
@ -839,6 +859,8 @@ ipc_compositor_init(struct ipc_client_compositor *icc, struct xrt_compositor_nat
|
|||
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;
|
||||
icc->base.base.get_display_refresh_rate = ipc_compositor_get_display_refresh_rate;
|
||||
icc->base.base.request_display_refresh_rate = ipc_compositor_request_display_refresh_rate;
|
||||
|
||||
// Using in wait frame.
|
||||
os_precise_sleeper_init(&icc->sleeper);
|
||||
|
|
|
@ -556,6 +556,31 @@ ipc_handle_compositor_discard_frame(volatile struct ipc_client_state *ics, int64
|
|||
return xrt_comp_discard_frame(ics->xc, frame_id);
|
||||
}
|
||||
|
||||
xrt_result_t
|
||||
ipc_handle_compositor_get_display_refresh_rate(volatile struct ipc_client_state *ics,
|
||||
float *out_display_refresh_rate_hz)
|
||||
{
|
||||
IPC_TRACE_MARKER();
|
||||
|
||||
if (ics->xc == NULL) {
|
||||
return XRT_ERROR_IPC_SESSION_NOT_CREATED;
|
||||
}
|
||||
|
||||
return xrt_comp_get_display_refresh_rate(ics->xc, out_display_refresh_rate_hz);
|
||||
}
|
||||
|
||||
xrt_result_t
|
||||
ipc_handle_compositor_request_display_refresh_rate(volatile struct ipc_client_state *ics, float display_refresh_rate_hz)
|
||||
{
|
||||
IPC_TRACE_MARKER();
|
||||
|
||||
if (ics->xc == NULL) {
|
||||
return XRT_ERROR_IPC_SESSION_NOT_CREATED;
|
||||
}
|
||||
|
||||
return xrt_comp_request_display_refresh_rate(ics->xc, display_refresh_rate_hz);
|
||||
}
|
||||
|
||||
static bool
|
||||
_update_projection_layer(struct xrt_compositor *xc,
|
||||
volatile struct ipc_client_state *ics,
|
||||
|
|
|
@ -203,6 +203,18 @@
|
|||
]
|
||||
},
|
||||
|
||||
"compositor_get_display_refresh_rate": {
|
||||
"out": [
|
||||
{"name": "out_display_refresh_rate_hz", "type": "float"}
|
||||
]
|
||||
},
|
||||
|
||||
"compositor_request_display_refresh_rate": {
|
||||
"in": [
|
||||
{"name": "display_refresh_rate_hz", "type": "float"}
|
||||
]
|
||||
},
|
||||
|
||||
"swapchain_get_properties": {
|
||||
"in": [
|
||||
{"name": "info", "type": "struct xrt_swapchain_create_info"}
|
||||
|
|
Loading…
Reference in a new issue