The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipc: Return XRT_ERROR_IPC_SESSION_NOT_CREATED if so is the case

authored by

Jakob Bornecrantz and committed by
Jakob Bornecrantz
741dcbdf 56278491

+52
+52
src/xrt/ipc/server/ipc_server_handler.c
··· 125 125 { 126 126 IPC_TRACE_MARKER(); 127 127 128 + if (ics->xc == NULL) { 129 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 130 + } 131 + 128 132 return xrt_comp_begin_session(ics->xc, 0); 129 133 } 130 134 ··· 133 137 { 134 138 IPC_TRACE_MARKER(); 135 139 140 + if (ics->xc == NULL) { 141 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 142 + } 143 + 136 144 return xrt_comp_end_session(ics->xc); 137 145 } 138 146 ··· 140 148 ipc_handle_compositor_get_info(volatile struct ipc_client_state *ics, struct xrt_compositor_info *out_info) 141 149 { 142 150 IPC_TRACE_MARKER(); 151 + 152 + if (ics->xc == NULL) { 153 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 154 + } 143 155 144 156 *out_info = ics->xc->info; 145 157 ··· 155 167 { 156 168 IPC_TRACE_MARKER(); 157 169 170 + if (ics->xc == NULL) { 171 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 172 + } 173 + 158 174 /* 159 175 * We use this to signal that the session has started, this is needed 160 176 * to make this client/session active/visible/focused. ··· 175 191 ipc_handle_compositor_wait_woke(volatile struct ipc_client_state *ics, int64_t frame_id) 176 192 { 177 193 IPC_TRACE_MARKER(); 194 + 195 + if (ics->xc == NULL) { 196 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 197 + } 178 198 179 199 return xrt_comp_mark_frame(ics->xc, frame_id, XRT_COMPOSITOR_FRAME_POINT_WOKE, os_monotonic_get_ns()); 180 200 } ··· 184 204 { 185 205 IPC_TRACE_MARKER(); 186 206 207 + if (ics->xc == NULL) { 208 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 209 + } 210 + 187 211 return xrt_comp_begin_frame(ics->xc, frame_id); 188 212 } 189 213 ··· 192 216 { 193 217 IPC_TRACE_MARKER(); 194 218 219 + if (ics->xc == NULL) { 220 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 221 + } 222 + 195 223 return xrt_comp_discard_frame(ics->xc, frame_id); 196 224 } 197 225 ··· 463 491 { 464 492 IPC_TRACE_MARKER(); 465 493 494 + if (ics->xc == NULL) { 495 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 496 + } 497 + 466 498 struct ipc_shared_memory *ism = ics->server->ism; 467 499 struct ipc_layer_slot *slot = &ism->slots[slot_id]; 468 500 xrt_graphics_sync_handle_t sync_handle = XRT_GRAPHICS_SYNC_HANDLE_INVALID; ··· 512 544 ipc_handle_compositor_poll_events(volatile struct ipc_client_state *ics, union xrt_compositor_event *out_xce) 513 545 { 514 546 IPC_TRACE_MARKER(); 547 + 548 + if (ics->xc == NULL) { 549 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 550 + } 515 551 516 552 return xrt_comp_poll_events(ics->xc, out_xce); 517 553 } ··· 719 755 xrt_result_t 720 756 ipc_handle_swapchain_wait_image(volatile struct ipc_client_state *ics, uint32_t id, uint64_t timeout, uint32_t index) 721 757 { 758 + if (ics->xc == NULL) { 759 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 760 + } 761 + 722 762 //! @todo Look up the index. 723 763 uint32_t sc_index = id; 724 764 struct xrt_swapchain *xsc = ics->xscs[sc_index]; ··· 731 771 xrt_result_t 732 772 ipc_handle_swapchain_acquire_image(volatile struct ipc_client_state *ics, uint32_t id, uint32_t *out_index) 733 773 { 774 + if (ics->xc == NULL) { 775 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 776 + } 777 + 734 778 //! @todo Look up the index. 735 779 uint32_t sc_index = id; 736 780 struct xrt_swapchain *xsc = ics->xscs[sc_index]; ··· 743 787 xrt_result_t 744 788 ipc_handle_swapchain_release_image(volatile struct ipc_client_state *ics, uint32_t id, uint32_t index) 745 789 { 790 + if (ics->xc == NULL) { 791 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 792 + } 793 + 746 794 //! @todo Look up the index. 747 795 uint32_t sc_index = id; 748 796 struct xrt_swapchain *xsc = ics->xscs[sc_index]; ··· 755 803 xrt_result_t 756 804 ipc_handle_swapchain_destroy(volatile struct ipc_client_state *ics, uint32_t id) 757 805 { 806 + if (ics->xc == NULL) { 807 + return XRT_ERROR_IPC_SESSION_NOT_CREATED; 808 + } 809 + 758 810 ics->num_swapchains--; 759 811 760 812 // Drop our reference, does NULL checking. Cast away volatile.