summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/drm/drm_fops.c')
-rw-r--r--sys/dev/drm/drm_fops.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/drm/drm_fops.c b/sys/dev/drm/drm_fops.c
index 9f05115..361f5a7 100644
--- a/sys/dev/drm/drm_fops.c
+++ b/sys/dev/drm/drm_fops.c
@@ -30,9 +30,11 @@
* Daryll Strauss <daryll@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "dev/drm/drmP.h"
drm_file_t *drm_find_file_by_proc(drm_device_t *dev, DRM_STRUCTPROC *p)
@@ -89,10 +91,12 @@ 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);
- if (dev->open_helper) {
- retcode = dev->open_helper(dev, priv);
+ /* for compatibility root is always authenticated */
+ priv->authenticated = DRM_SUSER(p);
+
+ if (dev->driver.open) {
+ retcode = dev->driver.open(dev, priv);
if (retcode != 0) {
free(priv, M_DRM);
DRM_UNLOCK();
@@ -100,6 +104,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();
OpenPOWER on IntegriCloud