dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly
@ 2018-12-11 22:04 François Tigeot
  2018-12-17 18:09 ` Emil Velikov
  0 siblings, 1 reply; 4+ messages in thread
From: François Tigeot @ 2018-12-11 22:04 UTC (permalink / raw)
  To: dri-devel; +Cc: François Tigeot

* 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@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-19 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11 22:04 [PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly François Tigeot
2018-12-17 18:09 ` Emil Velikov
2018-12-18 19:11   ` Francois Tigeot
2018-12-19 13:32     ` Eric Engestrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox