summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/drm_drv.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-12-01 01:37:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-12-01 01:37:18 +0000
commit92ccf7b4258b5797e7c4007278432e7a454c37f9 (patch)
tree30df494c29eb7c62a9bb4edbc8edb1a3af680952 /sys/dev/pci/drm/drm_drv.c
parentc7091b0c9c31b89c777d10177de816f0ada6fa06 (diff)
Add noop drm SET_MASTER and DROP_MASTER ioctls. This will allow
reducing the local diff in libdrm. We only handle a single master as xorg privdrop has already occurred at the point where the ioctls are issued.
Diffstat (limited to 'sys/dev/pci/drm/drm_drv.c')
-rw-r--r--sys/dev/pci/drm/drm_drv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index afd36baf2e5..3660953dc14 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_drv.c,v 1.150 2016/11/25 23:33:39 jsg Exp $ */
+/* $OpenBSD: drm_drv.c,v 1.151 2016/12/01 01:37:17 jsg Exp $ */
/*-
* Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org>
* Copyright © 2008 Intel Corporation
@@ -130,7 +130,13 @@ static struct drm_ioctl_desc drm_ioctls[] = {
#ifdef __linux__
DRM_IOCTL_DEF(DRM_IOCTL_SET_MASTER, drm_setmaster_ioctl, DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_DROP_MASTER, drm_dropmaster_ioctl, DRM_ROOT_ONLY),
+#else
+ /* On OpenBSD xorg privdrop has already occurred before this point */
+ DRM_IOCTL_DEF(DRM_IOCTL_SET_MASTER, drm_noop, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF(DRM_IOCTL_DROP_MASTER, drm_noop, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+#endif
+#ifdef __linux__
DRM_IOCTL_DEF(DRM_IOCTL_ADD_CTX, drm_addctx, DRM_AUTH|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_RM_CTX, drm_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
#endif