Commit graph

65 commits

Author SHA1 Message Date
Jakob Bornecrantz deedd10a50 xrt: Tidy xrt_instance_create argument order and add doc-comment 2020-07-08 14:41:12 +00:00
Ryan Pavlik 323d794df3 ipc: Add a json schema for the IPC description 2020-07-08 09:15:51 -05:00
Jakob Bornecrantz 8ee7086ea6 xrt: Introduce xrt_swapchain_create_info 2020-07-04 11:04:07 +00:00
Jakob Bornecrantz 5bad87690f ipc: Avoid deadlocks due to render timing helper not getting data in time 2020-07-01 13:22:03 +01:00
Pete Black bd5aa24463 xrt: Add multi client and overlay client support 2020-06-25 15:48:34 +01:00
Jakob Bornecrantz 513ebd9957 ipc: Remove no longer used semaphore code (NFC) 2020-06-24 22:57:00 +01:00
Jakob Bornecrantz e59b4a1cb1 ipc: Use new frame timing code 2020-06-24 11:42:46 +01:00
Jakob Bornecrantz b75f4f844b xrt: Add frame_id to compositor frame calls 2020-06-23 21:31:00 +01:00
Christoph Haag f31f1edde2 ipc: Set destroyed swapchains to not active
Fixes the service failing to create swapchains with "ERROR: Too many swapchains!"
after one or several sequentially started and quit clients created 32 swapchains.
2020-06-19 14:41:34 +02:00
Jakob Bornecrantz 65dcc82e3a comp+ipc: Respect view space layer flag 2020-06-15 23:59:04 +00:00
Christoph Haag 8141a3c761 ipc: Reset waitframe semaphore when client disconnects
The semaphore was usually kept at a value of 1 after a client disconnected,
meaning the next client to connect was never blocked on it.
2020-06-15 15:47:56 +02:00
Ryan Pavlik 172ff0f434 ipc: Simplify code by just copying a structure. 2020-06-09 17:13:06 -05:00
Ryan Pavlik 1881bb6357 ipc: Further de-duplication of structures 2020-06-09 17:07:22 -05:00
Ryan Pavlik b6b5052d48 ipc: Remove structs that effectively duplicate xrt_layer_data
The only non-duplicate members are the swapchain IDs,
so store those in their own array as already done elsewhere in the
codebase.
2020-06-09 17:07:22 -05:00
Ryan Pavlik f407fb9461 ipc: Doc comments 2020-06-09 17:07:22 -05:00
Ryan Pavlik eaa4c186ce ipc: Port to using xrt_sub_image where possible.
This highlighted several places where we are not considering an image rect,
but possibly should be.
2020-06-09 16:26:01 -05:00
Ryan Pavlik e0e5aeceda xrt: name xrt_swapchain pointers consistently "xsc" or similar.
As is tradition.
2020-06-09 15:29:46 -05:00
Jakob Bornecrantz 45c977d199 xrt: Introduce xrt_sub_image and xrt_layer_projection_view_data 2020-06-09 20:32:53 +01:00
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