···177177178178 os_mutex_lock(&mc->slot_lock);
179179180180+ struct multi_compositor volatile *v_mc = mc;
181181+180182 // Block here if the scheduled slot is not clear.
181181- while (mc->scheduled.active) {
183183+ while (v_mc->scheduled.active) {
184184+185185+ // This frame is for the next frame, drop the old one no matter what.
186186+ if (time_is_within_half_ms(mc->progress.display_time_ns, mc->slot_next_frame_display)) {
187187+ U_LOG_W("Dropping old missed frame in favour for completed new frame");
188188+ break;
189189+ }
182190183191 // Replace the scheduled frame if it's in the past.
184192 uint64_t now_ns = os_monotonic_get_ns();
185185- if (mc->scheduled.display_time_ns < now_ns) {
193193+ if (v_mc->scheduled.display_time_ns < now_ns) {
186194 break;
187195 }
196196+197197+ U_LOG_D("next: %f (%" PRIu64 ")\nprogress: %f (%" PRIu64 ")\nscheduled: %f (%" PRIu64 ")\n",
198198+ time_ns_to_ms_f((int64_t)v_mc->slot_next_frame_display - now_ns), //
199199+ v_mc->slot_next_frame_display, //
200200+ time_ns_to_ms_f((int64_t)v_mc->progress.display_time_ns - now_ns), //
201201+ v_mc->progress.display_time_ns, //
202202+ time_ns_to_ms_f((int64_t)v_mc->scheduled.display_time_ns - now_ns), //
203203+ v_mc->scheduled.display_time_ns); //
188204189205 os_mutex_unlock(&mc->slot_lock);
190206
+5
src/xrt/compositor/multi/comp_multi_private.h
···154154 struct os_mutex slot_lock;
155155156156 /*!
157157+ * The next which the next frames to be picked up will be displayed.
158158+ */
159159+ uint64_t slot_next_frame_display;
160160+161161+ /*!
157162 * Currently being transferred or waited on.
158163 * Not protected by the slot lock as it is only touched by the client thread.
159164 */