The open source OpenXR runtime

c/multi: Return from multi-compositor wait functions if the session has stopped.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2491>

authored by

Connor Smith and committed by
Marge Bot
e135cd3d e945b751

+7 -6
+7 -6
src/xrt/compositor/multi/comp_multi_compositor.c
··· 1 // Copyright 2019-2021, Collabora, Ltd. 2 // SPDX-License-Identifier: BSL-1.0 3 /*! 4 * @file ··· 123 } 124 125 static void 126 - wait_fence(struct xrt_compositor_fence **xcf_ptr) 127 { 128 COMP_TRACE_MARKER(); 129 xrt_result_t ret = XRT_SUCCESS; ··· 138 } 139 140 U_LOG_W("Waiting on client fence timed out > 100ms!"); 141 - } while (true); 142 143 xrt_compositor_fence_destroy(xcf_ptr); 144 ··· 148 } 149 150 static void 151 - wait_semaphore(struct xrt_compositor_semaphore **xcsem_ptr, uint64_t value) 152 { 153 COMP_TRACE_MARKER(); 154 xrt_result_t ret = XRT_SUCCESS; ··· 163 } 164 165 U_LOG_W("Waiting on client semaphore value '%" PRIu64 "' timed out > 100ms!", value); 166 - } while (true); 167 168 xrt_compositor_semaphore_reference(xcsem_ptr, NULL); 169 ··· 288 os_thread_helper_unlock(&mc->wait_thread.oth); 289 290 if (xcsem != NULL) { 291 - wait_semaphore(&xcsem, value); 292 } 293 if (xcf != NULL) { 294 - wait_fence(&xcf); 295 } 296 297 // Sample time outside of lock.
··· 1 // Copyright 2019-2021, Collabora, Ltd. 2 + // Copyright 2024-2025, NVIDIA CORPORATION. 3 // SPDX-License-Identifier: BSL-1.0 4 /*! 5 * @file ··· 124 } 125 126 static void 127 + wait_fence(struct multi_compositor *mc, struct xrt_compositor_fence **xcf_ptr) 128 { 129 COMP_TRACE_MARKER(); 130 xrt_result_t ret = XRT_SUCCESS; ··· 139 } 140 141 U_LOG_W("Waiting on client fence timed out > 100ms!"); 142 + } while (os_thread_helper_is_running(&mc->wait_thread.oth)); 143 144 xrt_compositor_fence_destroy(xcf_ptr); 145 ··· 149 } 150 151 static void 152 + wait_semaphore(struct multi_compositor *mc, struct xrt_compositor_semaphore **xcsem_ptr, uint64_t value) 153 { 154 COMP_TRACE_MARKER(); 155 xrt_result_t ret = XRT_SUCCESS; ··· 164 } 165 166 U_LOG_W("Waiting on client semaphore value '%" PRIu64 "' timed out > 100ms!", value); 167 + } while (os_thread_helper_is_running(&mc->wait_thread.oth)); 168 169 xrt_compositor_semaphore_reference(xcsem_ptr, NULL); 170 ··· 289 os_thread_helper_unlock(&mc->wait_thread.oth); 290 291 if (xcsem != NULL) { 292 + wait_semaphore(mc, &xcsem, value); 293 } 294 if (xcf != NULL) { 295 + wait_fence(mc, &xcf); 296 } 297 298 // Sample time outside of lock.