c/main: Revert "Transition to visible/focused after xrEndFrame, not xrWaitFrame"

This reverts commit e03ee48dce.
This commit is contained in:
Jakob Bornecrantz 2020-11-03 21:04:01 +00:00
parent 3dfa7167b2
commit e7643de8db
3 changed files with 10 additions and 12 deletions

View file

@ -210,6 +210,9 @@ compositor_wait_frame(struct xrt_compositor *xc,
*predicted_display_time = c->last_next_display_time; *predicted_display_time = c->last_next_display_time;
*out_frame_id = c->last_next_display_time; *out_frame_id = c->last_next_display_time;
if (c->state == COMP_STATE_PREPARED) {
c->state = COMP_STATE_WAITED;
}
return XRT_SUCCESS; return XRT_SUCCESS;
} }
@ -242,6 +245,10 @@ compositor_wait_frame(struct xrt_compositor *xc,
*out_frame_id = c->last_next_display_time; *out_frame_id = c->last_next_display_time;
c->last_next_display_time = next_display_time; c->last_next_display_time = next_display_time;
if (c->state == COMP_STATE_PREPARED) {
c->state = COMP_STATE_WAITED;
}
return XRT_SUCCESS; return XRT_SUCCESS;
} }
} }
@ -507,10 +514,6 @@ compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id)
c->expected_app_duration_ns = c->expected_app_duration_ns =
c->app_profiling.last_end - c->app_profiling.last_begin; c->app_profiling.last_end - c->app_profiling.last_begin;
if (c->state == COMP_STATE_PREPARED) {
c->state = COMP_STATE_COMMITTED;
}
// Now is a good point to garbage collect. // Now is a good point to garbage collect.
comp_compositor_garbage_collect(c); comp_compositor_garbage_collect(c);
return XRT_SUCCESS; return XRT_SUCCESS;
@ -532,8 +535,8 @@ compositor_poll_events(struct xrt_compositor *xc,
case COMP_STATE_PREPARED: case COMP_STATE_PREPARED:
out_xce->state.type = XRT_COMPOSITOR_EVENT_NONE; out_xce->state.type = XRT_COMPOSITOR_EVENT_NONE;
break; break;
case COMP_STATE_COMMITTED: case COMP_STATE_WAITED:
COMP_DEBUG(c, "COMMITTED -> VISIBLE"); COMP_DEBUG(c, "WAITED -> VISIBLE");
out_xce->state.type = XRT_COMPOSITOR_EVENT_STATE_CHANGE; out_xce->state.type = XRT_COMPOSITOR_EVENT_STATE_CHANGE;
out_xce->state.visible = true; out_xce->state.visible = true;
c->state = COMP_STATE_VISIBLE; c->state = COMP_STATE_VISIBLE;

View file

@ -129,7 +129,7 @@ enum comp_state
{ {
COMP_STATE_READY = 0, COMP_STATE_READY = 0,
COMP_STATE_PREPARED = 1, COMP_STATE_PREPARED = 1,
COMP_STATE_COMMITTED = 2, COMP_STATE_WAITED = 2,
COMP_STATE_VISIBLE = 3, COMP_STATE_VISIBLE = 3,
COMP_STATE_FOCUSED = 4, COMP_STATE_FOCUSED = 4,
}; };

View file

@ -1898,11 +1898,6 @@ oxr_session_frame_end(struct oxr_logger *log,
do_synchronize_state_change(log, sess); do_synchronize_state_change(log, sess);
// For emitting state changes, the compositor has to know
// whether the client is synchronized, i.e. has called
// xrEndFrame, even with 0 layers.
CALL_CHK(xrt_comp_layer_commit(xc, -1));
return oxr_session_success_result(sess); return oxr_session_success_result(sess);
} }