Commit 7eeaeb90 authored by Noralf Trønnes's avatar Noralf Trønnes

drm/file: Don't set master on in-kernel clients

It only makes sense for userspace clients.
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180618141739.48151-3-noralf@tronnes.org
parent 1572042a
...@@ -155,17 +155,8 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) ...@@ -155,17 +155,8 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
goto out_prime_destroy; goto out_prime_destroy;
} }
if (drm_is_primary_client(file)) {
ret = drm_master_open(file);
if (ret)
goto out_close;
}
return file; return file;
out_close:
if (dev->driver->postclose)
dev->driver->postclose(dev, file);
out_prime_destroy: out_prime_destroy:
if (drm_core_check_feature(dev, DRIVER_PRIME)) if (drm_core_check_feature(dev, DRIVER_PRIME))
drm_prime_destroy_file_private(&file->prime); drm_prime_destroy_file_private(&file->prime);
...@@ -365,6 +356,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) ...@@ -365,6 +356,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
{ {
struct drm_device *dev = minor->dev; struct drm_device *dev = minor->dev;
struct drm_file *priv; struct drm_file *priv;
int ret;
if (filp->f_flags & O_EXCL) if (filp->f_flags & O_EXCL)
return -EBUSY; /* No exclusive opens */ return -EBUSY; /* No exclusive opens */
...@@ -379,6 +371,14 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) ...@@ -379,6 +371,14 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
if (IS_ERR(priv)) if (IS_ERR(priv))
return PTR_ERR(priv); return PTR_ERR(priv);
if (drm_is_primary_client(priv)) {
ret = drm_master_open(priv);
if (ret) {
drm_file_free(priv);
return ret;
}
}
filp->private_data = priv; filp->private_data = priv;
filp->f_mode |= FMODE_UNSIGNED_OFFSET; filp->f_mode |= FMODE_UNSIGNED_OFFSET;
priv->filp = filp; priv->filp = filp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment