drm: remove authentication on master exit.
authorDave Airlie <airlied@redhat.com>
Thu, 27 Mar 2008 05:55:49 +0000 (15:55 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 27 Mar 2008 05:55:49 +0000 (15:55 +1000)
using contexts for this is bad for multiple masters

linux-core/drmP.h
linux-core/drm_context.c
linux-core/drm_fops.c

index c2c3cdd..f96e6be 100644 (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;
 
        /*
index febee9f..f3d69ff 100644 (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);
index d5c59b1..043552f 100644 (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)