The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

p/prober: disable all drivers when qwerty is enabled

qwerty is auto probed, making HMDs that are not auto probed always take precedence.
When setting QWERTY_ENABLE=1 the intent is usually to exclusively use qwerty.
Therefore we default to disabling all other drivers when this variable is set.

To make the old behavior of adding qwerty devices with lower priority than actual
devices, the variable QWERTY_COMBINE=1 is introduced.

authored by

Christoph Haag and committed by
Jakob Bornecrantz
162915f0 c6b5c532

+14
+14
src/xrt/state_trackers/prober/p_prober.c
··· 42 42 */ 43 43 44 44 DEBUG_GET_ONCE_LOG_OPTION(prober_log, "PROBER_LOG", U_LOGGING_INFO) 45 + DEBUG_GET_ONCE_BOOL_OPTION(qwerty_enable, "QWERTY_ENABLE", false) 46 + DEBUG_GET_ONCE_BOOL_OPTION(qwerty_combine, "QWERTY_COMBINE", false) 45 47 46 48 static void 47 49 add_device(struct prober *p, struct prober_device **out_dev); ··· 315 317 static void 316 318 disable_drivers_from_conflicts(struct prober *p) 317 319 { 320 + if (debug_get_bool_option_qwerty_enable() && !debug_get_bool_option_qwerty_combine()) { 321 + for (size_t entry = 0; entry < p->num_entries; entry++) { 322 + if (strcmp(p->entries[entry]->driver_name, "Qwerty") != 0) { 323 + P_INFO(p, "Disabling %s because we have %s", p->entries[entry]->driver_name, "Qwerty"); 324 + size_t index = p->num_disabled_drivers++; 325 + U_ARRAY_REALLOC_OR_FREE(p->disabled_drivers, char *, p->num_disabled_drivers); 326 + p->disabled_drivers[index] = (char *)p->entries[entry]->driver_name; 327 + } 328 + } 329 + return; 330 + } 331 + 318 332 for (size_t i = 0; i < num_driver_conflicts; i++) { 319 333 bool have_first = false; 320 334 bool have_second = false;