diff options
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 851a53f1acce..0d46627663b1 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -246,7 +246,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, | |||
246 | memset(priv, 0, sizeof(*priv)); | 246 | memset(priv, 0, sizeof(*priv)); |
247 | filp->private_data = priv; | 247 | filp->private_data = priv; |
248 | priv->filp = filp; | 248 | priv->filp = filp; |
249 | priv->uid = current->euid; | 249 | priv->uid = current_euid(); |
250 | priv->pid = task_pid_nr(current); | 250 | priv->pid = task_pid_nr(current); |
251 | priv->minor = idr_find(&drm_minors_idr, minor_id); | 251 | priv->minor = idr_find(&drm_minors_idr, minor_id); |
252 | priv->ioctl_count = 0; | 252 | priv->ioctl_count = 0; |
@@ -256,6 +256,9 @@ static int drm_open_helper(struct inode *inode, struct file *filp, | |||
256 | 256 | ||
257 | INIT_LIST_HEAD(&priv->lhead); | 257 | INIT_LIST_HEAD(&priv->lhead); |
258 | 258 | ||
259 | if (dev->driver->driver_features & DRIVER_GEM) | ||
260 | drm_gem_open(dev, priv); | ||
261 | |||
259 | if (dev->driver->open) { | 262 | if (dev->driver->open) { |
260 | ret = dev->driver->open(dev, priv); | 263 | ret = dev->driver->open(dev, priv); |
261 | if (ret < 0) | 264 | if (ret < 0) |
@@ -400,6 +403,9 @@ int drm_release(struct inode *inode, struct file *filp) | |||
400 | dev->driver->reclaim_buffers(dev, file_priv); | 403 | dev->driver->reclaim_buffers(dev, file_priv); |
401 | } | 404 | } |
402 | 405 | ||
406 | if (dev->driver->driver_features & DRIVER_GEM) | ||
407 | drm_gem_release(dev, file_priv); | ||
408 | |||
403 | drm_fasync(-1, filp, 0); | 409 | drm_fasync(-1, filp, 0); |
404 | 410 | ||
405 | mutex_lock(&dev->ctxlist_mutex); | 411 | mutex_lock(&dev->ctxlist_mutex); |