summaryrefslogtreecommitdiff
path: root/xf86drm.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2015-07-21 03:12:56 +1000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-07-29 18:04:15 +0100
commitfc083322b0c8a58b51976adf23a582bce8bb75f1 (patch)
treea5b9deb7b0e4637df7441c5da6b884d5292ea9c4 /xf86drm.c
parent66c3afb75fa993f2f8b00c2dd9c2ec37a3a9dfb6 (diff)
xf86drm: use the correct device minor names on OpenBSD
Add defines for the device minor names and make use of them in drmGetMinorName() so the correct paths will be used on OpenBSD. v2: don't add new defines to xf86drm.h to keep them out of the API as requested by Emil. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xf86drm.c b/xf86drm.c
index e23a51fc..5e029694 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -64,6 +64,16 @@
#include "xf86drm.h"
#include "libdrm_macros.h"
+#ifdef __OpenBSD__
+#define DRM_PRIMARY_MINOR_NAME "drm"
+#define DRM_CONTROL_MINOR_NAME "drmC"
+#define DRM_RENDER_MINOR_NAME "drmR"
+#else
+#define DRM_PRIMARY_MINOR_NAME "card"
+#define DRM_CONTROL_MINOR_NAME "controlD"
+#define DRM_RENDER_MINOR_NAME "renderD"
+#endif
+
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#define DRM_MAJOR 145
#endif
@@ -525,11 +535,11 @@ static const char *drmGetMinorName(int type)
{
switch (type) {
case DRM_NODE_PRIMARY:
- return "card";
+ return DRM_PRIMARY_MINOR_NAME;
case DRM_NODE_CONTROL:
- return "controlD";
+ return DRM_CONTROL_MINOR_NAME;
case DRM_NODE_RENDER:
- return "renderD";
+ return DRM_RENDER_MINOR_NAME;
default:
return NULL;
}