···2222#include "xrt/xrt_compiler.h"
2323#include "main/comp_window.h"
2424#include "main/comp_window_direct.h"
2525+#include "util/u_debug.h"
25262627#ifndef VK_EXT_acquire_drm_display
2728#error "Wayland direct requires the Vulkan extension VK_EXT_acquire_drm_display"
2829#endif
3030+3131+DEBUG_GET_ONCE_OPTION(requested_connector, "XRT_COMPOSITOR_WAYLAND_CONNECTOR", NULL)
29323033struct direct_wayland_lease
3134{
···430433 return false;
431434 }
432435433433- // Replace this with the value of an env variable
434434- const char *connector_name = NULL;
435435-436436- if (!connector_name) {
436436+ const char *requested_connector = debug_get_option_requested_connector();
437437+ if (requested_connector) {
438438+ COMP_INFO(w->c, "Requesting connector %s", requested_connector);
439439+ } else {
437440 COMP_INFO(w->c, "No connector was chosen, will use first available connector");
438441 }
439442440440- bool found = get_named_connector_or_first(w_wayland, connector_name);
443443+ bool found = get_named_connector_or_first(w_wayland, requested_connector);
441444442445 if (!w_wayland->selected_connector) {
443446 COMP_INFO(w->c, "Found no connectors available for direct mode");
···445448 }
446449447450 // Inform when chosen connector was not found
448448- if (connector_name && !found) {
449449- COMP_INFO(w->c, "Could not find requested connector, selected first available connector");
451451+ if (requested_connector && !found) {
452452+ COMP_WARN(w->c, "Could not find requested connector %s, selected first available connector %s",
453453+ requested_connector, w_wayland->selected_connector->name);
450454 }
451455452456 COMP_INFO(w->c, "Using DRM node %s", w_wayland->selected_device->path);