diff options
author | Eric Anholt <eric@anholt.net> | 2009-03-24 15:23:04 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-18 16:00:33 -0400 |
commit | 9a298b2acd771d8a5c0004d8f8e4156c65b11f6b (patch) | |
tree | f8bf6cfe675492cb881abb50d9aa9aa8f38733d6 /drivers/gpu/drm/i915/i915_mem.c | |
parent | 52dc7d32b88156248167864f77a9026abe27b432 (diff) |
drm: Remove memory debugging infrastructure.
It hasn't been used in ages, and having the user tell your how much
memory is being freed at free time is a recipe for disaster even if it
was ever used.
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_mem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_mem.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/i915_mem.c b/drivers/gpu/drm/i915/i915_mem.c index 96e271986d2a..83b7b81bb2b8 100644 --- a/drivers/gpu/drm/i915/i915_mem.c +++ b/drivers/gpu/drm/i915/i915_mem.c | |||
@@ -94,8 +94,8 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, | |||
94 | { | 94 | { |
95 | /* Maybe cut off the start of an existing block */ | 95 | /* Maybe cut off the start of an existing block */ |
96 | if (start > p->start) { | 96 | if (start > p->start) { |
97 | struct mem_block *newblock = | 97 | struct mem_block *newblock = kmalloc(sizeof(*newblock), |
98 | drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); | 98 | GFP_KERNEL); |
99 | if (!newblock) | 99 | if (!newblock) |
100 | goto out; | 100 | goto out; |
101 | newblock->start = start; | 101 | newblock->start = start; |
@@ -111,8 +111,8 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, | |||
111 | 111 | ||
112 | /* Maybe cut off the end of an existing block */ | 112 | /* Maybe cut off the end of an existing block */ |
113 | if (size < p->size) { | 113 | if (size < p->size) { |
114 | struct mem_block *newblock = | 114 | struct mem_block *newblock = kmalloc(sizeof(*newblock), |
115 | drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); | 115 | GFP_KERNEL); |
116 | if (!newblock) | 116 | if (!newblock) |
117 | goto out; | 117 | goto out; |
118 | newblock->start = start + size; | 118 | newblock->start = start + size; |
@@ -169,7 +169,7 @@ static void free_block(struct mem_block *p) | |||
169 | p->size += q->size; | 169 | p->size += q->size; |
170 | p->next = q->next; | 170 | p->next = q->next; |
171 | p->next->prev = p; | 171 | p->next->prev = p; |
172 | drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); | 172 | kfree(q); |
173 | } | 173 | } |
174 | 174 | ||
175 | if (p->prev->file_priv == NULL) { | 175 | if (p->prev->file_priv == NULL) { |
@@ -177,7 +177,7 @@ static void free_block(struct mem_block *p) | |||
177 | q->size += p->size; | 177 | q->size += p->size; |
178 | q->next = p->next; | 178 | q->next = p->next; |
179 | q->next->prev = q; | 179 | q->next->prev = q; |
180 | drm_free(p, sizeof(*q), DRM_MEM_BUFLISTS); | 180 | kfree(p); |
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
@@ -185,14 +185,14 @@ static void free_block(struct mem_block *p) | |||
185 | */ | 185 | */ |
186 | static int init_heap(struct mem_block **heap, int start, int size) | 186 | static int init_heap(struct mem_block **heap, int start, int size) |
187 | { | 187 | { |
188 | struct mem_block *blocks = drm_alloc(sizeof(*blocks), DRM_MEM_BUFLISTS); | 188 | struct mem_block *blocks = kmalloc(sizeof(*blocks), GFP_KERNEL); |
189 | 189 | ||
190 | if (!blocks) | 190 | if (!blocks) |
191 | return -ENOMEM; | 191 | return -ENOMEM; |
192 | 192 | ||
193 | *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS); | 193 | *heap = kmalloc(sizeof(**heap), GFP_KERNEL); |
194 | if (!*heap) { | 194 | if (!*heap) { |
195 | drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFLISTS); | 195 | kfree(blocks); |
196 | return -ENOMEM; | 196 | return -ENOMEM; |
197 | } | 197 | } |
198 | 198 | ||
@@ -233,7 +233,7 @@ void i915_mem_release(struct drm_device * dev, struct drm_file *file_priv, | |||
233 | p->size += q->size; | 233 | p->size += q->size; |
234 | p->next = q->next; | 234 | p->next = q->next; |
235 | p->next->prev = p; | 235 | p->next->prev = p; |
236 | drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); | 236 | kfree(q); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | } | 239 | } |
@@ -250,10 +250,10 @@ void i915_mem_takedown(struct mem_block **heap) | |||
250 | for (p = (*heap)->next; p != *heap;) { | 250 | for (p = (*heap)->next; p != *heap;) { |
251 | struct mem_block *q = p; | 251 | struct mem_block *q = p; |
252 | p = p->next; | 252 | p = p->next; |
253 | drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); | 253 | kfree(q); |
254 | } | 254 | } |
255 | 255 | ||
256 | drm_free(*heap, sizeof(**heap), DRM_MEM_BUFLISTS); | 256 | kfree(*heap); |
257 | *heap = NULL; | 257 | *heap = NULL; |
258 | } | 258 | } |
259 | 259 | ||