]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/gpu/drm/drm_fops.c
saner FASYNC handling on file close
[linux-2.6-omap-h63xx.git] / drivers / gpu / drm / drm_fops.c
index 851a53f1accefa0ee1d84772a6ec5a182d609969..78eeed5caaff1ed68ed01cb2cd27a2ed156caa49 100644 (file)
@@ -246,7 +246,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
        memset(priv, 0, sizeof(*priv));
        filp->private_data = priv;
        priv->filp = filp;
-       priv->uid = current->euid;
+       priv->uid = current_euid();
        priv->pid = task_pid_nr(current);
        priv->minor = idr_find(&drm_minors_idr, minor_id);
        priv->ioctl_count = 0;
@@ -256,6 +256,9 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
 
        INIT_LIST_HEAD(&priv->lhead);
 
+       if (dev->driver->driver_features & DRIVER_GEM)
+               drm_gem_open(dev, priv);
+
        if (dev->driver->open) {
                ret = dev->driver->open(dev, priv);
                if (ret < 0)
@@ -400,7 +403,8 @@ int drm_release(struct inode *inode, struct file *filp)
                dev->driver->reclaim_buffers(dev, file_priv);
        }
 
-       drm_fasync(-1, filp, 0);
+       if (dev->driver->driver_features & DRIVER_GEM)
+               drm_gem_release(dev, file_priv);
 
        mutex_lock(&dev->ctxlist_mutex);
        if (!list_empty(&dev->ctxlist)) {