Add Monado patch to test dynamic profiles

This commit is contained in:
Patrick Nicolas
2025-02-21 18:43:15 +01:00
parent be7c0862bb
commit 8443406a8f
@@ -0,0 +1,40 @@
From 6321ad3eee7d4a8b304a36de008d8fb8359f3dfe Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Wed, 19 Feb 2025 10:13:36 +0100
Subject: [PATCH] st/oxr: bind to dynamic role's profile
---
src/xrt/state_trackers/oxr/oxr_binding.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/xrt/state_trackers/oxr/oxr_binding.c b/src/xrt/state_trackers/oxr/oxr_binding.c
index eb8bb5489..b04977a8b 100644
--- a/src/xrt/state_trackers/oxr/oxr_binding.c
+++ b/src/xrt/state_trackers/oxr/oxr_binding.c
@@ -380,6 +380,23 @@ oxr_find_profile_for_device(struct oxr_logger *log,
return;
}
+ // Have bindings for the dynamic role's profile been suggested?
+#define FIND_PROFILE(X) \
+ { \
+ struct xrt_device *role_xdev = GET_XDEV_BY_ROLE(sess->sys, X); \
+ if (role_xdev == xdev) { \
+ enum xrt_device_name profile = GET_PROFILE_NAME_BY_ROLE(sess->sys, X); \
+ oxr_get_profile_for_device_name(log, sess, profile, out_p); \
+ if (*out_p != NULL) { \
+ return; \
+ } \
+ } \
+ }
+ FIND_PROFILE(left);
+ FIND_PROFILE(right);
+ FIND_PROFILE(gamepad);
+#undef FIND_PROFILE
+
// Have bindings for this device's interaction profile been suggested?
oxr_get_profile_for_device_name(log, sess, xdev->name, out_p);
if (*out_p != NULL) {
--
2.48.1