diff --git a/src/xrt/drivers/ohmd/oh_prober.c b/src/xrt/drivers/ohmd/oh_prober.c index ba3a56c0b..5f35fd0c2 100644 --- a/src/xrt/drivers/ohmd/oh_prober.c +++ b/src/xrt/drivers/ohmd/oh_prober.c @@ -1,4 +1,4 @@ -// Copyright 2019, Collabora, Ltd. +// Copyright 2019-2020, Collabora, Ltd. // SPDX-License-Identifier: BSL-1.0 /*! * @file @@ -22,6 +22,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(oh_spew, "OH_PRINT_SPEW", false) DEBUG_GET_ONCE_BOOL_OPTION(oh_debug, "OH_PRINT_DEBUG", false) +DEBUG_GET_ONCE_BOOL_OPTION(oh_external, "OH_EXTERNAL_DRIVER", false) struct oh_prober { @@ -70,6 +71,7 @@ oh_prober_autoprobe(struct xrt_auto_prober *xap, /* Then loop */ for (int i = 0; i < num_devices; i++) { int device_class = 0, device_flags = 0; + const char *prod = NULL; ohmd_list_geti(ohp->ctx, i, OHMD_DEVICE_CLASS, &device_class); ohmd_list_geti(ohp->ctx, i, OHMD_DEVICE_FLAGS, &device_flags); @@ -87,6 +89,16 @@ oh_prober_autoprobe(struct xrt_auto_prober *xap, continue; } + prod = ohmd_list_gets(ohp->ctx, i, OHMD_PRODUCT); + if (strcmp(prod, "External Device") == 0 && + !debug_get_bool_option_oh_external()) { + OH_DEBUG( + ohp, + "Rejecting device idx %i, is a External device.", + i); + continue; + } + OH_DEBUG(ohp, "Selecting device idx %i", i); device_idx = i; break; diff --git a/src/xrt/targets/common/target_lists.c b/src/xrt/targets/common/target_lists.c index d5af4f6a2..a4e2d59d0 100644 --- a/src/xrt/targets/common/target_lists.c +++ b/src/xrt/targets/common/target_lists.c @@ -89,7 +89,7 @@ xrt_auto_prober_creator target_auto_list[] = { #endif #ifdef XRT_BUILD_DRIVER_OHMD - // OpenHMD last as we want to override it with native drivers. + // OpenHMD second last as we want to override it with native drivers. oh_create_auto_prober, #endif