From: Dave Airlie Date: Thu, 27 Mar 2008 05:55:49 +0000 (+1000) Subject: drm: remove authentication on master exit. X-Git-Tag: libdrm-2.4.3~16^2~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acb6c9ef97df999f3fa87639b1bb4f2840970f71;p=platform%2Fupstream%2Flibdrm.git drm: remove authentication on master exit. using contexts for this is bad for multiple masters --- diff --git a/linux-core/drmP.h b/linux-core/drmP.h index c2c3cdd..f96e6be 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -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; /* diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c index febee9f..f3d69ff 100644 --- a/linux-core/drm_context.c +++ b/linux-core/drm_context.c @@ -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); diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index d5c59b1..043552f 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -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)