aboutsummaryrefslogtreecommitdiff
path: root/common/drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/drm.c')
-rw-r--r--common/drm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/drm.c b/common/drm.c
index 9591dc0..0d8096a 100644
--- a/common/drm.c
+++ b/common/drm.c
@@ -6,6 +6,11 @@
#include <sys/sysmacros.h>
#endif
+#if defined(__NetBSD__)
+#include <stdlib.h>
+#include <sys/stat.h>
+#endif
+
#include "drm.h"
// From libdrm
@@ -40,6 +45,16 @@ int path_is_drm(const char *path) {
static const int prefixlen = STRLEN(prefix);
return strncmp(prefix, path, prefixlen) == 0;
}
+#elif defined(__NetBSD__)
+int path_is_drm(const char *path) {
+ static const char prefix[] = "/dev/dri/";
+ static const int prefixlen = STRLEN(prefix);
+ return strncmp(prefix, path, prefixlen) == 0;
+}
+
+int dev_is_drm(dev_t device) {
+ return major(device) == getdevmajor("drm", S_IFCHR);
+}
#else
#error Unsupported platform
#endif