drm: remove authentication on master exit.

using contexts for this is bad for multiple masters
main
Dave Airlie 2008-03-27 15:55:49 +10:00
parent 71b66b0043
commit acb6c9ef97
3 changed files with 7 additions and 10 deletions

View File

@ -415,7 +415,6 @@ struct drm_file {
unsigned long ioctl_count;
struct list_head lhead;
struct drm_minor *minor;
int remove_auth_on_close;
unsigned long lock_count;
/*

View File

@ -444,9 +444,6 @@ int drm_rmctx(struct drm_device *dev, void *data,
struct drm_ctx *ctx = data;
DRM_DEBUG("%d\n", ctx->handle);
if (ctx->handle == DRM_KERNEL_CONTEXT + 1) {
file_priv->remove_auth_on_close = 1;
}
if (ctx->handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_dtor)
dev->driver->context_dtor(dev, ctx->handle);

View File

@ -489,6 +489,13 @@ int drm_release(struct inode *inode, struct file *filp)
drm_fb_release(filp);
if (file_priv->is_master) {
struct drm_file *temp;
list_for_each_entry(temp, &dev->filelist, lhead) {
if ((temp->master == file_priv->master) &&
(temp != file_priv))
temp->authenticated = 0;
}
if (file_priv->minor->master == file_priv->master)
file_priv->minor->master = NULL;
drm_put_master(file_priv->master);
@ -499,15 +506,9 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&dev->struct_mutex);
drm_object_release(filp);
if (file_priv->remove_auth_on_close == 1) {
struct drm_file *temp;
list_for_each_entry(temp, &dev->filelist, lhead)
temp->authenticated = 0;
}
list_del(&file_priv->lhead);
mutex_unlock(&dev->struct_mutex);
if (dev->driver->postclose)