summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_fops.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2014-08-08 01:30:53 +0400
committerDave Airlie <airlied@gmail.com>2014-08-08 01:30:53 +0400
commit7963e9db1b1f842fdc53309baa8714d38e9f5681 (patch)
tree9829f2d38b6df9f5a07c349766e77b002cb34539 /drivers/gpu/drm/drm_fops.c
parentfa1d0ee69ca8c123dd791d52830a2e146985ce85 (diff)
downloadlinux-7963e9db1b1f842fdc53309baa8714d38e9f5681.tar.xz
Revert "drm: drop redundant drm_file->is_master"
This reverts commit 48ba813701eb14b3008edefef4a0789b328e278c. Thanks to Chris: "drm_file->is_master is not synomous with having drm_file->master == drm_file->minor->master. This is because drm_file->master is the same for all drm_files of the same generation and so when there is a master, every drm_file believes itself to be the master. Confusion ensues and things go pear shaped when one file is closed and there is no master anymore." Conflicts: drivers/gpu/drm/drm_drv.c drivers/gpu/drm/drm_stub.c
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r--drivers/gpu/drm/drm_fops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 4b060942cb3c..79d5221c6e41 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -194,6 +194,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
goto out_close;
}
+ priv->is_master = 1;
/* take another reference for the copy in the local file priv */
priv->master = drm_master_get(priv->minor->master);
priv->authenticated = 1;
@@ -425,7 +426,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&dev->master_mutex);
- if (drm_is_master(file_priv)) {
+ if (file_priv->is_master) {
struct drm_master *master = file_priv->master;
/**
@@ -453,6 +454,7 @@ int drm_release(struct inode *inode, struct file *filp)
/* drop the master reference held by the file priv */
if (file_priv->master)
drm_master_put(&file_priv->master);
+ file_priv->is_master = 0;
mutex_unlock(&dev->master_mutex);
if (dev->driver->postclose)