From 56a8e8084463f1c5932527cfd0ceb9e583b89c48 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Fri, 3 Apr 2020 17:22:53 +0200 Subject: [PATCH] c/direct_mode: Print meaningful error if no display matches NVIDIA whitelist. --- .../compositor/main/comp_window_direct_mode.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/xrt/compositor/main/comp_window_direct_mode.c b/src/xrt/compositor/main/comp_window_direct_mode.c index b5a87da5b..510960e43 100644 --- a/src/xrt/compositor/main/comp_window_direct_mode.c +++ b/src/xrt/compositor/main/comp_window_direct_mode.c @@ -359,6 +359,23 @@ comp_window_direct_init_nvidia(struct comp_window *w) break; } + if (w_direct->num_nv_displays == 0) { + COMP_ERROR(w->c, + "NVIDIA: No machting displays found. " + "Is your headset whitelisted?"); + + COMP_ERROR(w->c, "== Whitelist =="); + for (uint32_t i = 0; i < ARRAY_SIZE(NV_DIRECT_WHITELIST); i++) + COMP_ERROR(w->c, "%s", NV_DIRECT_WHITELIST[i]); + + COMP_ERROR(w->c, "== Available =="); + for (uint32_t i = 0; i < display_count; i++) + COMP_ERROR(w->c, "%s", display_props[i].displayName); + + free(display_props); + return false; + } + free(display_props); return true;