c/multi: Also check if a semaphore or fence has been pushed in layer_begin

Closes 
This commit is contained in:
Jakob Bornecrantz 2022-05-25 22:52:52 +01:00 committed by Ryan Pavlik
parent 433915b0bf
commit 1b7631bd54

View file

@ -124,6 +124,14 @@ drain_events(struct multi_compositor *mc)
*
*/
static bool
is_pushed_or_waiting_locked(struct multi_compositor *mc)
{
return mc->wait_thread.waiting || //
mc->wait_thread.xcf != NULL || //
mc->wait_thread.xcsem != NULL; //
}
static void
wait_fence(struct xrt_compositor_fence **xcf_ptr)
{
@ -305,7 +313,7 @@ static void
wait_for_wait_thread_locked(struct multi_compositor *mc)
{
// Should we wait for the last frame.
if (mc->wait_thread.waiting) {
if (is_pushed_or_waiting_locked(mc)) {
COMP_TRACE_IDENT(blocked);
// There should only be one thread entering here.