aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r--drivers/gpu/drm/drm_gem.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index cff7317d3830..3ea0692ce59a 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -92,12 +92,6 @@ drm_gem_init(struct drm_device *dev)
92 92
93 spin_lock_init(&dev->object_name_lock); 93 spin_lock_init(&dev->object_name_lock);
94 idr_init(&dev->object_name_idr); 94 idr_init(&dev->object_name_idr);
95 atomic_set(&dev->object_count, 0);
96 atomic_set(&dev->object_memory, 0);
97 atomic_set(&dev->pin_count, 0);
98 atomic_set(&dev->pin_memory, 0);
99 atomic_set(&dev->gtt_count, 0);
100 atomic_set(&dev->gtt_memory, 0);
101 95
102 mm = kzalloc(sizeof(struct drm_gem_mm), GFP_KERNEL); 96 mm = kzalloc(sizeof(struct drm_gem_mm), GFP_KERNEL);
103 if (!mm) { 97 if (!mm) {
@@ -151,9 +145,6 @@ int drm_gem_object_init(struct drm_device *dev,
151 kref_init(&obj->handlecount); 145 kref_init(&obj->handlecount);
152 obj->size = size; 146 obj->size = size;
153 147
154 atomic_inc(&dev->object_count);
155 atomic_add(obj->size, &dev->object_memory);
156
157 return 0; 148 return 0;
158} 149}
159EXPORT_SYMBOL(drm_gem_object_init); 150EXPORT_SYMBOL(drm_gem_object_init);
@@ -180,8 +171,6 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size)
180 return obj; 171 return obj;
181fput: 172fput:
182 /* Object_init mangles the global counters - readjust them. */ 173 /* Object_init mangles the global counters - readjust them. */
183 atomic_dec(&dev->object_count);
184 atomic_sub(obj->size, &dev->object_memory);
185 fput(obj->filp); 174 fput(obj->filp);
186free: 175free:
187 kfree(obj); 176 kfree(obj);
@@ -436,10 +425,7 @@ drm_gem_release(struct drm_device *dev, struct drm_file *file_private)
436void 425void
437drm_gem_object_release(struct drm_gem_object *obj) 426drm_gem_object_release(struct drm_gem_object *obj)
438{ 427{
439 struct drm_device *dev = obj->dev;
440 fput(obj->filp); 428 fput(obj->filp);
441 atomic_dec(&dev->object_count);
442 atomic_sub(obj->size, &dev->object_memory);
443} 429}
444EXPORT_SYMBOL(drm_gem_object_release); 430EXPORT_SYMBOL(drm_gem_object_release);
445 431