The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: introduce XRT_COMPOSITOR_WAYLAND_CONNECTOR env var to request connector

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2295>

authored by

Simon Zeni and committed by
Marge Bot
570c9563 dfc60228

+12 -7
+1
doc/changes/compositor/mr.2295.md
··· 1 + wayland: introduce the environment variable 'WAYLAND_CONNECTOR' to request a specific connector
+11 -7
src/xrt/compositor/main/comp_window_direct_wayland.c
··· 22 22 #include "xrt/xrt_compiler.h" 23 23 #include "main/comp_window.h" 24 24 #include "main/comp_window_direct.h" 25 + #include "util/u_debug.h" 25 26 26 27 #ifndef VK_EXT_acquire_drm_display 27 28 #error "Wayland direct requires the Vulkan extension VK_EXT_acquire_drm_display" 28 29 #endif 30 + 31 + DEBUG_GET_ONCE_OPTION(requested_connector, "XRT_COMPOSITOR_WAYLAND_CONNECTOR", NULL) 29 32 30 33 struct direct_wayland_lease 31 34 { ··· 430 433 return false; 431 434 } 432 435 433 - // Replace this with the value of an env variable 434 - const char *connector_name = NULL; 435 - 436 - if (!connector_name) { 436 + const char *requested_connector = debug_get_option_requested_connector(); 437 + if (requested_connector) { 438 + COMP_INFO(w->c, "Requesting connector %s", requested_connector); 439 + } else { 437 440 COMP_INFO(w->c, "No connector was chosen, will use first available connector"); 438 441 } 439 442 440 - bool found = get_named_connector_or_first(w_wayland, connector_name); 443 + bool found = get_named_connector_or_first(w_wayland, requested_connector); 441 444 442 445 if (!w_wayland->selected_connector) { 443 446 COMP_INFO(w->c, "Found no connectors available for direct mode"); ··· 445 448 } 446 449 447 450 // Inform when chosen connector was not found 448 - if (connector_name && !found) { 449 - COMP_INFO(w->c, "Could not find requested connector, selected first available connector"); 451 + if (requested_connector && !found) { 452 + COMP_WARN(w->c, "Could not find requested connector %s, selected first available connector %s", 453 + requested_connector, w_wayland->selected_connector->name); 450 454 } 451 455 452 456 COMP_INFO(w->c, "Using DRM node %s", w_wayland->selected_device->path);