int ret = 0;
dev->master = drm_master_get(fpriv->master);
- fpriv->is_master = 1;
if (dev->driver->master_set) {
ret = dev->driver->master_set(dev, fpriv, new_master);
if (unlikely(ret != 0)) {
- fpriv->is_master = 0;
drm_master_put(&dev->master);
}
}
if (ret)
goto out_err;
}
- fpriv->allowed_master = 1;
+ fpriv->is_master = 1;
fpriv->authenticated = 1;
ret = drm_set_master(dev, fpriv, true);
goto out_unlock;
}
- if (!file_priv->allowed_master) {
+ if (!file_priv->is_master) {
ret = drm_new_set_master(dev, file_priv);
goto out_unlock;
}
if (dev->driver->master_drop)
dev->driver->master_drop(dev, fpriv);
drm_master_put(&dev->master);
- fpriv->is_master = 0;
}
int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
bool drm_is_current_master(struct drm_file *fpriv)
{
- return fpriv->is_master;
+ return fpriv->is_master && fpriv->master == fpriv->minor->dev->master;
}
EXPORT_SYMBOL(drm_is_current_master);
/** File private data */
struct drm_file {
unsigned authenticated :1;
- /* Whether we're master for a minor. Protected by master_mutex */
- unsigned is_master :1;
/* true when the client has asked us to expose stereo 3D mode flags */
unsigned stereo_allowed :1;
/*
/* true if client understands atomic properties */
unsigned atomic:1;
/*
- * This client is allowed to gain master privileges for @master.
+ * This client is the creator of @master.
* Protected by struct drm_device::master_mutex.
*/
- unsigned allowed_master:1;
+ unsigned is_master:1;
struct pid *pid;
kuid_t uid;