diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-30 06:46:12 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-01 09:45:20 -0400 |
commit | 73aa808f10effc280e6eb70267314542a7c29426 (patch) | |
tree | e8c7d0e25bb5d0658c47ff0339aec9a65367bbc2 /drivers/gpu/drm/drm_gem.c | |
parent | 6a04002bea137d2c6359228316d9c827806e475f (diff) |
drm: Move the GTT accounting to i915
Only drm/i915 does the bookkeeping that makes the information useful,
and the information maintained is driver specific, so move it out of the
core and into its single user.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 14 |
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 | } |
159 | EXPORT_SYMBOL(drm_gem_object_init); | 150 | EXPORT_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; |
181 | fput: | 172 | fput: |
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); |
186 | free: | 175 | free: |
187 | kfree(obj); | 176 | kfree(obj); |
@@ -436,10 +425,7 @@ drm_gem_release(struct drm_device *dev, struct drm_file *file_private) | |||
436 | void | 425 | void |
437 | drm_gem_object_release(struct drm_gem_object *obj) | 426 | drm_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 | } |
444 | EXPORT_SYMBOL(drm_gem_object_release); | 430 | EXPORT_SYMBOL(drm_gem_object_release); |
445 | 431 | ||