The HMD display device apparently needs to be the first one in
the xdevs list. Comments in xrt_prober.h seem to confirm this.
Order hmd and slam device acccordingly in the north_star target
builder.
Otherwise XR client calls to xrEndFrame(), at least with projection
layers, will cause monado-service to crash, as it chooses the
"slam device" xdev as "HMD", instead of the actual hmd device,
and therefore dereferences a xdev->hmd which is NULL inside
_update_projection_layer() and thereby segfaults.
gdb backtrace after SIGSEGV:
_update_projection_layer (xc=0x7ffe60000bf0, ics=0x5555560a5208, layer=0x7fff0a5ed620, i=0) at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_handler.c:749
749 uint32_t view_count = xdev->hmd->view_count;
(gdb) bt
0 _update_projection_layer (xc=0x7ffe60000bf0, ics=0x5555560a5208, layer=0x7fff0a5ed620, i=0) at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_handler.c:749
1 0x00005555555abd30 in _update_layers (ics=0x5555560a5208, xc=0x7ffe60000bf0, slot=0x7fff0a5ed600) at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_handler.c:973
2 0x00005555555ac060 in ipc_handle_compositor_layer_sync (ics=0x5555560a5208, slot_id=0, out_free_slot_id=0x7fff0a5ef134, handles=0x7fff0a5ef170, handle_count=0)
at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_handler.c:1058
3 0x00005555555a7167 in ipc_dispatch (ics=0x5555560a5208, ipc_command=0x7fff0a5ef840) at /home/dragon/projects/monado/build/src/xrt/ipc/ipc_server_generated.c:518
4 0x00005555555a56cc in client_loop (ics=0x5555560a5208) at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_per_client_thread.c:191
5 0x00005555555a593d in ipc_server_client_thread (_ics=0x5555560a5208) at /home/dragon/projects/monado/src/xrt/ipc/server/ipc_server_per_client_thread.c:332
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2228>
Aliasing XRT_INPUT_GENERIC_GRIP_SURFACE_POSE to XRT_INPUT_GENERIC_PALM_POSE
would be complicated because it is implemented as an enum.
Therefore, just reuse XRT_INPUT_GENERIC_PALM_POSE for now.
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
v2:
xrt: Allow NULL space in locate_spaces
For action spaces, an xrt_space is found if
get_xrt_space -> get_xrt_space_action -> oxr_action_get_pose_input
finds an active input. If no input is active, the xrt_space will be NULL.
ipc: Check allocation of space_ids for locate_spaces
st/oxr: Fix memory leak in xrLocateSpaces with invalid spaces
v3: ipc: Return error when locate_spaces allocation fails
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
Add vulkan and external-renderdoc to oxr-interfaces, needed on windows.
Also add compile definitions to oxr-interfaces
This is necessary for OXR_EXTENSION_SUPPORT_GENERATE to generate the same
list of extensions when including oxr_objects.h.
(e.g. XR_USE_OPENGL will not be set, causing struct oxr_extension_status
to not have a KHR_opengl_enable menmber.
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>