From ce90c0a1c700af3b26f089909d05a413d19cc77b Mon Sep 17 00:00:00 2001 From: Gabriele Boccone Date: Thu, 19 Oct 2023 11:16:58 +0200 Subject: [PATCH] t/common: Fix creation on no driver available Only say we can create a system if we have a driver in legacy builder. --- src/xrt/targets/common/target_builder_legacy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xrt/targets/common/target_builder_legacy.c b/src/xrt/targets/common/target_builder_legacy.c index 6747e0dd2..af5df87ab 100644 --- a/src/xrt/targets/common/target_builder_legacy.c +++ b/src/xrt/targets/common/target_builder_legacy.c @@ -99,9 +99,12 @@ legacy_estimate_system(struct xrt_builder *xb, struct xrt_prober *xp, struct xrt_builder_estimate *estimate) { - estimate->maybe.head = true; - estimate->maybe.left = true; - estimate->maybe.right = true; + // If no driver is enabled, there is no way to create a HMD + bool may_create_hmd = xb->driver_identifier_count > 0; + + estimate->maybe.head = may_create_hmd; + estimate->maybe.left = may_create_hmd; + estimate->maybe.right = may_create_hmd; estimate->priority = -20; return XRT_SUCCESS;