diff options
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 3a6c439652a5..3733e36d135e 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -35,7 +35,6 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "drmP.h" | 37 | #include "drmP.h" |
38 | #include "drm_sarea.h" | ||
39 | #include <linux/poll.h> | 38 | #include <linux/poll.h> |
40 | #include <linux/smp_lock.h> | 39 | #include <linux/smp_lock.h> |
41 | 40 | ||
@@ -55,10 +54,12 @@ static int drm_setup(struct drm_device * dev) | |||
55 | 54 | ||
56 | atomic_set(&dev->ioctl_count, 0); | 55 | atomic_set(&dev->ioctl_count, 0); |
57 | atomic_set(&dev->vma_count, 0); | 56 | atomic_set(&dev->vma_count, 0); |
58 | dev->buf_use = 0; | ||
59 | atomic_set(&dev->buf_alloc, 0); | ||
60 | 57 | ||
61 | if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) { | 58 | if (drm_core_check_feature(dev, DRIVER_HAVE_DMA) && |
59 | !drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
60 | dev->buf_use = 0; | ||
61 | atomic_set(&dev->buf_alloc, 0); | ||
62 | |||
62 | i = drm_dma_setup(dev); | 63 | i = drm_dma_setup(dev); |
63 | if (i < 0) | 64 | if (i < 0) |
64 | return i; | 65 | return i; |
@@ -138,14 +139,14 @@ int drm_open(struct inode *inode, struct file *filp) | |||
138 | } | 139 | } |
139 | spin_unlock(&dev->count_lock); | 140 | spin_unlock(&dev->count_lock); |
140 | } | 141 | } |
141 | |||
142 | out: | 142 | out: |
143 | mutex_lock(&dev->struct_mutex); | 143 | mutex_lock(&dev->struct_mutex); |
144 | if (dev->dev_mapping == NULL) | 144 | if (minor->type == DRM_MINOR_LEGACY) { |
145 | dev->dev_mapping = inode->i_mapping; | 145 | BUG_ON((dev->dev_mapping != NULL) && |
146 | else if (dev->dev_mapping != inode->i_mapping) | 146 | (dev->dev_mapping != inode->i_mapping)); |
147 | WARN(1, "dev->dev_mapping not inode mapping (%p expected %p)\n", | 147 | if (dev->dev_mapping == NULL) |
148 | dev->dev_mapping, inode->i_mapping); | 148 | dev->dev_mapping = inode->i_mapping; |
149 | } | ||
149 | mutex_unlock(&dev->struct_mutex); | 150 | mutex_unlock(&dev->struct_mutex); |
150 | 151 | ||
151 | return retcode; | 152 | return retcode; |
@@ -251,6 +252,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, | |||
251 | priv->lock_count = 0; | 252 | priv->lock_count = 0; |
252 | 253 | ||
253 | INIT_LIST_HEAD(&priv->lhead); | 254 | INIT_LIST_HEAD(&priv->lhead); |
255 | INIT_LIST_HEAD(&priv->fbs); | ||
254 | 256 | ||
255 | if (dev->driver->driver_features & DRIVER_GEM) | 257 | if (dev->driver->driver_features & DRIVER_GEM) |
256 | drm_gem_open(dev, priv); | 258 | drm_gem_open(dev, priv); |