Commit b64cd300 authored by Pete Black's avatar Pete Black

WIP: misc fixes to overlays and monado-ctl before rebasing on master

parent 4da217ba
Pipeline #155982 failed with stages
in 1 minute and 57 seconds
......@@ -55,6 +55,7 @@ ipc_handle_session_create(volatile struct ipc_client_state *cs,
cs->session_state = XR_SESSION_STATE_IDLE;
if (oi->is_overlay) {
cs->overlay_enabled = true;
cs->overlay_z_order = oi->z_order;
//@todo handle flags
}
update_server_state(cs->server);
......@@ -376,6 +377,10 @@ ipc_handle_system_get_client_info(struct ipc_client_state *_cs,
if (cs->server->active_client_index == id) {
out_client_desc->session_displayed = true;
}
out_client_desc->z_order = cs->overlay_z_order;
out_client_desc->session_overlay = cs->overlay_enabled;
out_client_desc->info = cs->client_descriptor.info;
return IPC_SUCCESS;
}
......
......@@ -607,7 +607,7 @@ _app_sort_func(const void *a, const void *b)
if (oa->force_first) {
return -1;
}
return (oa->z_order - ob->z_order);
return (oa->z_order < ob->z_order);
}
static void
......@@ -659,12 +659,12 @@ _update_layers(struct comp_compositor *c,
comp_renderer_destroy_quads(c->r);
comp_renderer_allocate_quads(c->r, n);
}
uint32_t quad_index = 0;
for (uint32_t i = 0; i < IPC_MAX_CLIENTS; i++) {
struct _z_sort_data *zd = &z_data[i];
if (zd->index >= 0) {
uint32_t quad_index = 0;
for (uint32_t i = 0;
i <
s->thread_state[zd->index].render_state.num_layers;
......@@ -746,6 +746,8 @@ main_loop(struct ipc_server *vs)
if (render_state->rendering) {
_update_layers(c, vs, &num_quads);
printf("updating render state with %d quads\n",
num_quads);
// set our client state back to waiting.
render_state->rendering = false;
......@@ -967,7 +969,8 @@ update_server_state(struct ipc_server *vs)
int fallback_active_application = -1;
for (uint32_t i = 0; i < IPC_MAX_CLIENTS; i++) {
if (vs->thread_state[i].server_thread_index >= 0 &&
if (vs->thread_state[i].overlay_enabled == false &&
vs->thread_state[i].server_thread_index >= 0 &&
is_active_state(vs->thread_state[i].session_state)) {
fallback_active_application = i;
set_idle = false;
......@@ -976,7 +979,9 @@ update_server_state(struct ipc_server *vs)
// if our externally-set active application is not actually
// active/displayable, use the fallback application instead.
if (!(vs->active_client_index >= 0 &&
if (!(vs->thread_state[vs->active_client_index].overlay_enabled ==
false &&
vs->active_client_index >= 0 &&
is_active_state(
vs->thread_state[vs->active_client_index].session_state))) {
vs->active_client_index = fallback_active_application;
......@@ -1004,6 +1009,10 @@ update_server_state(struct ipc_server *vs)
vs->thread_state[i].session_state)) {
set_idle = false;
}
handle_overlay_client_events(
&vs->thread_state[i], vs->active_client_index,
vs->last_active_client_index);
vs->thread_state[i].last_session_state =
vs->thread_state[i].session_state;
}
......
......@@ -94,7 +94,9 @@ is_active_state(XrSessionState s)
case XR_SESSION_STATE_EXITING:
case XR_SESSION_STATE_UNKNOWN:
case XR_SESSION_STATE_MAX_ENUM:
case XR_SESSION_STATE_LOSS_PENDING: return false;
case XR_SESSION_STATE_LOSS_PENDING:
case XR_SESSION_STATE_STOPPING:
case XR_SESSION_STATE_READY: return false;
default: return true;
}
}
......@@ -112,13 +112,14 @@ main(int argc, char *argv[])
exit(1);
}
printf(
"client: %d\tact: %d\tdisplayed: "
"%d\tpid: %d\tname: %s\tz_order: "
"%d\n",
"id: %d\tact: %d\tdisp: "
"%d\tovly: %d\tz: %d\tpid: "
"%d\t %s\t\n",
clients.ids[i], cd.session_active,
cd.session_displayed, cd.info.pid,
cd.info.application_name,
cd.z_order);
cd.session_displayed,
cd.session_overlay, cd.z_order,
cd.info.pid,
cd.info.application_name);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment