Commit graph

83 commits

Author SHA1 Message Date
Ryan Pavlik c3552ed420 xrt: Rename xrt_gfx_fd.h to xrt_gfx_native.h 2020-07-15 17:19:30 -05:00
Ryan Pavlik 54f56716fd xrt: Rename references to compositor/swapchain/image_fd to ..._native.
Reflecting that the native buffer isn't an FD on all platforms.
2020-07-15 09:11:58 -05:00
Ryan Pavlik 86d93601d7 ipc: Work on Android using AHardwareBuffer instead of FDs for graphics 2020-07-14 16:37:55 -05:00
Ryan Pavlik 44fe0e7709 build: Handle Android NDK better. 2020-07-14 16:37:55 -05:00
Ryan Pavlik 60cf946dd7 ipc: Normalize parameter names 2020-07-14 16:37:12 -05:00
Ryan Pavlik abc580d2b1 ipc: Replace "out_fds" with more generic "out_handles"
Also, finish porting client code to use factored-out utils.
2020-07-14 16:37:12 -05:00
Ryan Pavlik 040c82cb24 ipc: Port server side to use new factored-out utils 2020-07-14 16:24:26 -05:00
Ryan Pavlik 166c041421 ipc: Start providing handle marshalling util functions 2020-07-14 16:24:26 -05:00
Ryan Pavlik 1a692f5de6 ipc: Use factored-out utils on client side. 2020-07-14 16:24:26 -05:00
Ryan Pavlik 36f66ea630 ipc: Add factored-out basic message send/receive 2020-07-14 16:24:26 -05:00
Ryan Pavlik a5bde51c81 ipc: Change return type of some server functions from int to xrt_result_t 2020-07-14 16:24:26 -05:00
Ryan Pavlik c2e922b0f5 ipc: Formatting cleanup 2020-07-14 16:24:26 -05:00
Ryan Pavlik 87dbad9865 ipc: Have server utils return xrt_result_t 2020-07-14 16:24:26 -05:00
Ryan Pavlik 687beddcca ipc: Replace ipc_connection_t usage with struct ipc_connection 2020-07-14 16:24:23 -05:00
Ryan Pavlik cf68e11b97 ipc: Be more strict in type parsing 2020-07-14 16:18:17 -05:00
Ryan Pavlik 1b88c7e089 ipc: Move data structure out of generation script 2020-07-14 16:18:17 -05:00
Christoph Haag b073e3dfb9 xrt: Add support for assigned device roles
Abandons the assumption that in oxr_system.xdevs[], index 0 is HMD,
1 is left controller, 2 is right controller.

Now to represent the dynamically assigned roles, oxr_system.role contains
the index for a device in oxr_system.xdevs[] for head, left and right.

This role assignment happens on the client side and currently can not be updated
from the server side.

Also adds an enum that device drivers set indicating allowed assignments
(many controllers are physically designed to be held in a specific hand).

This also adds support for configurations with only a HMD and a right controller.
2020-07-13 18:03:01 +02:00
Christoph Haag 5788fb90a2 drivers: Add rotation/position tracking bool to xdev
xrGetSystemProperties() will return these values to application in XrSystemTrackingProperties
using the xdev assigned to head.
2020-07-13 18:03:01 +02:00
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