Commit graph

247 commits

Author SHA1 Message Date
Jakob Bornecrantz 55e026245a xrt: Use new xrt_layer_data in layer functions 2020-06-09 19:04:48 +00:00
Jakob Bornecrantz 320c9ab3cb ipc+comp: Use new xrt_layer_data and friends struct 2020-06-09 19:04:48 +00:00
Jakob Bornecrantz 5912964ded ipc+comp: Even more make layers the same 2020-06-09 19:04:48 +00:00
Lubosz Sarnecki 08d81e5950 ipc+comp: Make layer structs more consistent.
Add missing fields.
Sort layer struct members.
ipc/protocol: Move xdev_id and name to common layer struct.
2020-06-09 19:04:48 +00:00
Lubosz Sarnecki b1d39e7f07 xrt: Move layer enum to xrt namespace. 2020-06-09 19:04:47 +00:00
Christoph Haag bc995e3aab ipc: Return XR_ERROR_INSTANCE_LOST instead of SIGABRT on the client side 2020-06-05 16:06:32 +02:00
Christoph Haag cc9b415a8f xrt: Add xrt_result_t return type to many functions
Many functions returned void and were assumed to always succeed, and some functions
returned only a bool to indicate vague success/failure.

Now that these functions get piped over IPC all of them have to be able to indicate
an IPC failure like for example an unreachable service.

With the xrt_result_t return type they now have the opportunity to report various
types of failures.
2020-06-05 16:06:32 +02:00
Christoph Haag db5db10a19 ipc: Replace ipc_result_t with global xrt_result_t
Functions down the line should be able to fail and return a status.

They can be called either through IPC or directly depending on compile settings,
therefore we need an internal result type for various XR_ERROR_* errors, but also IPC failure.

For now functions in ipc_client_utils.c only return XRT_SUCCESS or XRT_ERROR_IPC_FAILURE.
If there is no IPC failure, the generated protocol will extract and return the called functions'
actual return value from the reply.

v2: make failure results negative
2020-06-05 16:02:38 +02:00
Ryan Pavlik bc6cc85e7d xrt: Improve doxygen documentation. 2020-06-03 16:28:18 -05:00
Jakob Bornecrantz fb867b02c3 xrt: Remove array_size field on xrt_swapchain 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 9ec0b559d4 ipc/util: Don't follow null pointers and add alignment paranoia 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 05827abd8e ipc/server: Fix swapchain handling 2020-06-02 13:02:04 +01:00
Lubosz Sarnecki 7186bddf60 c/comp+ipc: Use array indices again.
This fixes a regression introduced by the IPC and layer rendering
patchsets and passes the array_index to the correct places, so the
correct VkImageView is used instead of the one with index 0.
2020-06-02 12:42:42 +02:00
Lubosz Sarnecki 4ad806df38 ipc/server_process: Check for swapchain NULL pointer.
Skip rendering when swapchains are invalid.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki d0539161dc c/renderer+ipc: Use layer renderer.
Make the renderer and IPC aware of multiple projection and quad layers
using the layer renderer.

Remove redundant code related to idle images and imported buffers and
command buffer rebuild, since we now always just display the layer
renderer's frame buffer.

Get view and projection properties from xrt_device.
2020-05-28 22:16:57 +00:00
Ryan Pavlik cef1970340 ipc: Make script more pythonic 2020-05-28 13:22:30 -05:00
Ryan Pavlik ff3a4d8b50 ipc: Fix all Flake8 warnings 2020-05-28 13:20:28 -05:00
Ryan Pavlik 4efdb6762a ipc: More script simplification. 2020-05-28 11:56:22 -05:00
Ryan Pavlik 0964a6dd07 ipc: Clean up generation script 2020-05-28 11:34:36 -05:00
Ryan Pavlik a44a915151 ipc: Put generator main in a function, for testing purposes 2020-05-28 11:34:36 -05:00
Ryan Pavlik 8bd1ac776e ipc: Fix class methods, mistaken use of class variables in IPC generator 2020-05-28 11:34:36 -05:00
Ryan Pavlik a034260ec3 ipc/client: Remove implementation of xrt_prober_create 2020-05-27 18:40:56 -05:00
Jakob Bornecrantz e8e7493679 ipc: Pass all arguments to create swapchain image 2020-05-27 21:57:48 +01:00
Jakob Bornecrantz 18fbd3f819 ipc: Make the XR client actually wait in wait frame by setting the correct semaphore value 2020-05-27 17:50:06 +01:00
Jakob Bornecrantz 7ab48b691c c/main&ipc: Adopt to flip y in layers change
Client side changes by Lubosz Sarnecki.
2020-05-26 11:33:58 +01:00
Lubosz Sarnecki e445f60ccf ipc: Add client side support for layers. 2020-05-26 11:33:58 +01:00
Jakob Bornecrantz b7b9d9307b ipc: Remove leftover fprintf (NFC) 2020-05-23 13:54:49 +01:00
Christoph Haag b32652c4df ipc: Implement xrWaitFrame by waiting on a shared semaphore v2
Version 2 additions by Jakob, still use a semaphore to wake up the client.
But now instead call the compositor wait frame and have that thread wake up
the client, and return immediatly on the IPC channel.
2020-05-13 17:07:08 +01:00
Ryan Pavlik 098ddde5da ipc: Fix typo 2020-05-12 11:46:53 -05:00
Christoph Haag 26539e79b6 ipc: Fix looking up tracking origins
Fixes #78
2020-05-09 21:14:24 +02:00
Jakob Bornecrantz cf3a337547 ipc: Be paranoid about tracking origins 2020-05-09 19:37:48 +01:00
Jakob Bornecrantz 66bcdf712e ipc: Track tracking origins with variable tracking 2020-05-09 12:43:26 +01:00
Jakob Bornecrantz ee163cbdb2 ipc: Reflect tracking origins correctly 2020-05-09 12:43:26 +01:00
Ryan Pavlik 8f6b7b930a ipc: Output the attempted filename in the bind error message. 2020-05-08 14:53:03 -05:00
Ryan Pavlik 83cace51d4 ipc: Add error message on bind failure. 2020-05-07 17:00:25 -05:00
Ryan Pavlik c4f8c7fdf7 ipc: Unlink on exit, not before start. 2020-05-07 16:55:10 -05:00
Ryan Pavlik 5935fad73b ipc: Add ability for service to be launched by systemd socket activation. 2020-05-07 16:54:11 -05:00
Ryan Pavlik d7e84cf5b5 build: Fix include directories for IPC server module 2020-05-07 15:46:29 -05:00
Jakob Bornecrantz d8428b2544 ipc/client: Don't assert on devices with no output 2020-05-01 19:20:03 +01:00
Christoph Haag 7ab1ca727f ipc: Make send_and_get_reply thread safe
When multiple threads call OpenXR functions, make sure one thread
can not read the reply meant for another thread.

Unfortunately this also blocks other OpenXR functions from being
called while xrWaitFrame() is blocking.
2020-05-01 16:11:26 +02:00
Christoph Haag d491f59b55 ipc: Log unexpected messaging events as errors
Any of these unexpected events will likely lead to more errors down the line.
Always printing them as errors will make it easier to diagnose the ipc.
2020-05-01 16:11:00 +02:00
Christoph Haag a195f22bc3 ipc: disconnect client on xrDestroyInstance()
The service considers clients to be connected as long as the fd is not closed.
After destroying an XrInstance this prevents the client from creating a subsequent XrInstance.
2020-05-01 02:49:44 +02:00
Jakob Bornecrantz a4dcdf1f0b ipc/server: Improve error messages 2020-04-30 20:45:34 +01:00
Jakob Bornecrantz 6d770336b7 ipc/server: Pass in MSG_NOSIGNAL to not get SIGPIPEd 2020-04-30 20:44:35 +01:00
Jakob Bornecrantz a02293e8dd ipc: Improve swapchain handling a tiny bit 2020-04-30 20:44:35 +01:00
Jakob Bornecrantz 11539e28b7 ipc/server: Fix swapchain being swapped left and right 2020-04-30 14:00:27 +01:00
Jakob Bornecrantz 7c8a8a3f87 ipc: Add code to enable a service process
This enables out of process compositing.
2020-04-29 14:58:24 +01:00