From 5c8f255a3587256def3a50dc603cd6267ac29d29 Mon Sep 17 00:00:00 2001 From: Bastien Date: Tue, 18 Sep 2018 21:51:26 +0200 Subject: [PATCH] Improved HMD DRM connector detection (non-desktop flag) --- src/swapChain.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/swapChain.c b/src/swapChain.c index 7a522ed..33e3977 100644 --- a/src/swapChain.c +++ b/src/swapChain.c @@ -63,7 +63,17 @@ static int drm_find_psvr_fd(SwapChain * swapChain, int fd) drmModePropertyPtr prop = drmModeGetProperty(fd, connectorToTest->props[j]); if (prop) { - if (strcmp(prop->name, "EDID") == 0) + if (prop->flags & DRM_MODE_PROP_RANGE && strcmp(prop->name, "non-desktop") == 0) + { + uint64_t value = connectorToTest->prop_values[j]; + + if (value == 1) + { + connector = connectorToTest; + break; + } + } + else if (prop->flags & DRM_MODE_PROP_BLOB && strcmp(prop->name, "EDID") == 0 && 0) { drmModePropertyBlobPtr blob_ptr = drmModeGetPropertyBlob(fd, connectorToTest->prop_values[j]); if (blob_ptr)