[PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly

François Tigeot ftigeot at wolfpond.org
Tue Dec 11 22:04:01 UTC 2018


* There is no way to check if a device name is really a drm device
  by looking it up in a virtual filesystem like on Linux

* The major device number is also dynamically allocated from a pool,
  comparing it to a constant makes no sense

* In the absence of better ideas, just assume the device name really
  points to a drm device and always return true

Signed-off-by: François Tigeot <ftigeot at wolfpond.org>
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xf86drm.c b/xf86drm.c
index 71ad54ba..0085bf17 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2778,6 +2778,8 @@ static bool drmNodeIsDRM(int maj, int min)
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm",
              maj, min);
     return stat(path, &sbuf) == 0;
+#elif __DragonFly__
+    return true;	/* DragonFly BSD has no fixed major device numbers */
 #else
     return maj == DRM_MAJOR;
 #endif
-- 
2.19.2



More information about the dri-devel mailing list