summaryrefslogtreecommitdiff
path: root/bsd-core/drm_fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/drm_fops.c')
-rw-r--r--bsd-core/drm_fops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c
index b15fd056..f5c9349b 100644
--- a/bsd-core/drm_fops.c
+++ b/bsd-core/drm_fops.c
@@ -88,7 +88,9 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
priv->refs = 1;
priv->minor = m;
priv->ioctl_count = 0;
- priv->authenticated = !DRM_SUSER(p);
+
+ /* for compatibility root is always authenticated */
+ priv->authenticated = DRM_SUSER(p);
if (dev->driver.open) {
retcode = dev->driver.open(dev, priv);
@@ -99,6 +101,9 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
}
}
+ /* first opener automatically becomes master */
+ priv->master = TAILQ_EMPTY(&dev->files);
+
TAILQ_INSERT_TAIL(&dev->files, priv, link);
}
DRM_UNLOCK();