blob: 2bab7c4eb3751e52e1445238d8ac9e43a2048fb0 [file] [log] [blame]
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -07001/*
2 * drivers/gpu/ion/ion_system_heap.c
3 *
4 * Copyright (C) 2011 Google, Inc.
Mitchel Humpherysaf3b5222013-01-15 15:38:52 -08005 * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -07006 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -070018#include <asm/page.h>
19#include <linux/dma-mapping.h>
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -070020#include <linux/err.h>
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -070021#include <linux/highmem.h>
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -070022#include <linux/ion.h>
23#include <linux/mm.h>
24#include <linux/scatterlist.h>
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070025#include <linux/seq_file.h>
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -070026#include <linux/slab.h>
27#include <linux/vmalloc.h>
28#include "ion_priv.h"
Neeti Desai3f3c2822013-03-08 17:29:53 -080029#include <linux/dma-mapping.h>
Adrian Alexei21f62bd2013-04-22 12:57:41 -070030#include <trace/events/kmem.h>
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -070031
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070032static unsigned int high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO |
33 __GFP_NOWARN | __GFP_NORETRY |
Rebecca Schultz Zavin1797e59a2012-10-18 21:51:53 -070034 __GFP_NO_KSWAPD) & ~__GFP_WAIT;
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070035static unsigned int low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO |
36 __GFP_NOWARN);
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070037static const unsigned int orders[] = {8, 4, 0};
38static const int num_orders = ARRAY_SIZE(orders);
39static int order_to_index(unsigned int order)
40{
41 int i;
42 for (i = 0; i < num_orders; i++)
43 if (order == orders[i])
44 return i;
45 BUG();
46 return -1;
47}
48
49static unsigned int order_to_size(int order)
50{
51 return PAGE_SIZE << order;
52}
53
54struct ion_system_heap {
55 struct ion_heap heap;
56 struct ion_page_pool **pools;
57};
58
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -070059struct page_info {
60 struct page *page;
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070061 unsigned int order;
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -070062 struct list_head list;
63};
64
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070065static struct page *alloc_buffer_page(struct ion_system_heap *heap,
66 struct ion_buffer *buffer,
67 unsigned long order)
68{
69 bool cached = ion_buffer_cached(buffer);
70 bool split_pages = ion_buffer_fault_user_mappings(buffer);
71 struct ion_page_pool *pool = heap->pools[order_to_index(order)];
72 struct page *page;
Rebecca Schultz Zavin96dd58d2012-09-26 10:58:30 -070073
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070074 if (!cached) {
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070075 page = ion_page_pool_alloc(pool);
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070076 } else {
Rebecca Schultz Zavin220a6522012-10-18 21:54:01 -070077 struct scatterlist sg;
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070078 gfp_t gfp_flags = low_order_gfp_flags;
79
80 if (order > 4)
81 gfp_flags = high_order_gfp_flags;
Adrian Alexei21f62bd2013-04-22 12:57:41 -070082 trace_alloc_pages_sys_start(gfp_flags, order);
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070083 page = alloc_pages(gfp_flags, order);
Adrian Alexei21f62bd2013-04-22 12:57:41 -070084 trace_alloc_pages_sys_end(gfp_flags, order);
85 if (!page) {
86 trace_alloc_pages_sys_fail(gfp_flags, order);
Rebecca Schultz Zavin220a6522012-10-18 21:54:01 -070087 return 0;
Adrian Alexei21f62bd2013-04-22 12:57:41 -070088 }
Rebecca Schultz Zavin220a6522012-10-18 21:54:01 -070089 sg_init_table(&sg, 1);
90 sg_set_page(&sg, page, PAGE_SIZE << order, 0);
Laura Abbottcd09f602013-06-05 07:45:37 -070091 sg_dma_address(&sg) = sg_phys(&sg);
Rebecca Schultz Zavin220a6522012-10-18 21:54:01 -070092 dma_sync_sg_for_device(NULL, &sg, 1, DMA_BIDIRECTIONAL);
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -070093 }
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070094 if (!page)
95 return 0;
Rebecca Schultz Zavin220a6522012-10-18 21:54:01 -070096
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -070097 if (split_pages)
98 split_page(page, order);
99 return page;
100}
101
102static void free_buffer_page(struct ion_system_heap *heap,
103 struct ion_buffer *buffer, struct page *page,
Rebecca Schultz Zavinca12f5d2013-01-09 11:26:37 -0800104 unsigned int order)
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700105{
106 bool cached = ion_buffer_cached(buffer);
107 bool split_pages = ion_buffer_fault_user_mappings(buffer);
108 int i;
109
110 if (!cached) {
111 struct ion_page_pool *pool = heap->pools[order_to_index(order)];
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700112 ion_page_pool_free(pool, page);
113 } else if (split_pages) {
114 for (i = 0; i < (1 << order); i++)
115 __free_page(page + i);
116 } else {
117 __free_pages(page, order);
118 }
119}
120
121
122static struct page_info *alloc_largest_available(struct ion_system_heap *heap,
123 struct ion_buffer *buffer,
124 unsigned long size,
Rebecca Schultz Zavin158316f2012-09-25 20:55:27 -0700125 unsigned int max_order)
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700126{
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700127 struct page *page;
128 struct page_info *info;
129 int i;
130
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700131 for (i = 0; i < num_orders; i++) {
132 if (size < order_to_size(orders[i]))
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700133 continue;
Rebecca Schultz Zavin158316f2012-09-25 20:55:27 -0700134 if (max_order < orders[i])
135 continue;
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700136
137 page = alloc_buffer_page(heap, buffer, orders[i]);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700138 if (!page)
139 continue;
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700140
141 info = kmalloc(sizeof(struct page_info), GFP_KERNEL);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700142 info->page = page;
143 info->order = orders[i];
144 return info;
145 }
146 return NULL;
147}
148
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700149static int ion_system_heap_allocate(struct ion_heap *heap,
150 struct ion_buffer *buffer,
151 unsigned long size, unsigned long align,
152 unsigned long flags)
153{
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700154 struct ion_system_heap *sys_heap = container_of(heap,
155 struct ion_system_heap,
156 heap);
Laura Abbottb14ed962012-01-30 14:18:08 -0800157 struct sg_table *table;
158 struct scatterlist *sg;
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700159 int ret;
160 struct list_head pages;
161 struct page_info *info, *tmp_info;
Rebecca Schultz Zavinf858ba42012-09-21 11:46:06 -0700162 int i = 0;
Olav Haugand8770692013-04-17 16:11:31 -0700163 unsigned long size_remaining = PAGE_ALIGN(size);
Rebecca Schultz Zavin158316f2012-09-25 20:55:27 -0700164 unsigned int max_order = orders[0];
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700165 bool split_pages = ion_buffer_fault_user_mappings(buffer);
Rebecca Schultz Zavin158316f2012-09-25 20:55:27 -0700166
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700167 INIT_LIST_HEAD(&pages);
168 while (size_remaining > 0) {
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700169 info = alloc_largest_available(sys_heap, buffer, size_remaining, max_order);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700170 if (!info)
171 goto err;
172 list_add_tail(&info->list, &pages);
173 size_remaining -= (1 << info->order) * PAGE_SIZE;
Rebecca Schultz Zavin158316f2012-09-25 20:55:27 -0700174 max_order = info->order;
Rebecca Schultz Zavinf858ba42012-09-21 11:46:06 -0700175 i++;
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700176 }
Laura Abbott68c80642011-10-21 17:32:27 -0700177
Laura Abbottb14ed962012-01-30 14:18:08 -0800178 table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
179 if (!table)
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700180 goto err;
181
Rebecca Schultz Zavinf858ba42012-09-21 11:46:06 -0700182 if (split_pages)
183 ret = sg_alloc_table(table, PAGE_ALIGN(size) / PAGE_SIZE,
184 GFP_KERNEL);
185 else
186 ret = sg_alloc_table(table, i, GFP_KERNEL);
187
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700188 if (ret)
189 goto err1;
190
191 sg = table->sgl;
192 list_for_each_entry_safe(info, tmp_info, &pages, list) {
193 struct page *page = info->page;
Rebecca Schultz Zavinf858ba42012-09-21 11:46:06 -0700194 if (split_pages) {
195 for (i = 0; i < (1 << info->order); i++) {
196 sg_set_page(sg, page + i, PAGE_SIZE, 0);
197 sg = sg_next(sg);
198 }
199 } else {
200 sg_set_page(sg, page, (1 << info->order) * PAGE_SIZE,
201 0);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700202 sg = sg_next(sg);
203 }
204 list_del(&info->list);
Rebecca Schultz Zavin6a93a292012-08-21 21:35:20 -0700205 kfree(info);
Laura Abbottb14ed962012-01-30 14:18:08 -0800206 }
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700207
Laura Abbottb14ed962012-01-30 14:18:08 -0800208 buffer->priv_virt = table;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700209 return 0;
Laura Abbottb14ed962012-01-30 14:18:08 -0800210err1:
Laura Abbottb14ed962012-01-30 14:18:08 -0800211 kfree(table);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700212err:
213 list_for_each_entry(info, &pages, list) {
Rebecca Schultz Zavinca12f5d2013-01-09 11:26:37 -0800214 free_buffer_page(sys_heap, buffer, info->page, info->order);
Rebecca Schultz Zavin6a93a292012-08-21 21:35:20 -0700215 kfree(info);
Rebecca Schultz Zavinb831c8c2012-06-14 13:30:01 -0700216 }
Laura Abbottb14ed962012-01-30 14:18:08 -0800217 return -ENOMEM;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700218}
219
220void ion_system_heap_free(struct ion_buffer *buffer)
221{
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700222 struct ion_heap *heap = buffer->heap;
223 struct ion_system_heap *sys_heap = container_of(heap,
224 struct ion_system_heap,
225 heap);
Rebecca Schultz Zavin3df181c2012-11-15 10:43:46 -0800226 struct sg_table *table = buffer->sg_table;
Rebecca Schultz Zavinca12f5d2013-01-09 11:26:37 -0800227 bool cached = ion_buffer_cached(buffer);
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700228 struct scatterlist *sg;
229 LIST_HEAD(pages);
230 int i;
Laura Abbottb14ed962012-01-30 14:18:08 -0800231
Rebecca Schultz Zavinca12f5d2013-01-09 11:26:37 -0800232 /* uncached pages come from the page pools, zero them before returning
233 for security purposes (other allocations are zerod at alloc time */
234 if (!cached)
235 ion_heap_buffer_zero(buffer);
Rebecca Schultz Zavinf9101222012-12-18 22:46:57 -0800236
Laura Abbottb14ed962012-01-30 14:18:08 -0800237 for_each_sg(table->sgl, sg, table->nents, i)
Rebecca Schultz Zavinf9101222012-12-18 22:46:57 -0800238 free_buffer_page(sys_heap, buffer, sg_page(sg),
Rebecca Schultz Zavinca12f5d2013-01-09 11:26:37 -0800239 get_order(sg_dma_len(sg)));
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700240 sg_free_table(table);
241 kfree(table);
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700242}
243
Laura Abbottb14ed962012-01-30 14:18:08 -0800244struct sg_table *ion_system_heap_map_dma(struct ion_heap *heap,
245 struct ion_buffer *buffer)
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700246{
Laura Abbottb14ed962012-01-30 14:18:08 -0800247 return buffer->priv_virt;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700248}
249
250void ion_system_heap_unmap_dma(struct ion_heap *heap,
251 struct ion_buffer *buffer)
252{
Laura Abbottb14ed962012-01-30 14:18:08 -0800253 return;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700254}
255
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700256static struct ion_heap_ops system_heap_ops = {
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700257 .allocate = ion_system_heap_allocate,
258 .free = ion_system_heap_free,
259 .map_dma = ion_system_heap_map_dma,
260 .unmap_dma = ion_system_heap_unmap_dma,
Rebecca Schultz Zavin3df181c2012-11-15 10:43:46 -0800261 .map_kernel = ion_heap_map_kernel,
262 .unmap_kernel = ion_heap_unmap_kernel,
263 .map_user = ion_heap_map_user,
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700264};
265
Laura Abbott5046c952013-04-18 09:40:43 -0700266static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
267 void *unused)
268{
269
270 struct ion_system_heap *sys_heap = container_of(heap,
271 struct ion_system_heap,
272 heap);
273 int i;
274 for (i = 0; i < num_orders; i++) {
275 struct ion_page_pool *pool = sys_heap->pools[i];
276 seq_printf(s, "%d order %u highmem pages in pool = %lu total\n",
277 pool->high_count, pool->order,
278 (1 << pool->order) * PAGE_SIZE * pool->high_count);
279 seq_printf(s, "%d order %u lowmem pages in pool = %lu total\n",
280 pool->low_count, pool->order,
281 (1 << pool->order) * PAGE_SIZE * pool->low_count);
282 }
283 return 0;
284}
285
Laura Abbottb629a822013-04-18 09:56:04 -0700286struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused)
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700287{
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700288 struct ion_system_heap *heap;
289 int i;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700290
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700291 heap = kzalloc(sizeof(struct ion_system_heap), GFP_KERNEL);
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700292 if (!heap)
293 return ERR_PTR(-ENOMEM);
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700294 heap->heap.ops = &system_heap_ops;
295 heap->heap.type = ION_HEAP_TYPE_SYSTEM;
Rebecca Schultz Zavin618d6be2013-02-13 14:48:11 -0800296 heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE;
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700297 heap->pools = kzalloc(sizeof(struct ion_page_pool *) * num_orders,
298 GFP_KERNEL);
299 if (!heap->pools)
300 goto err_alloc_pools;
301 for (i = 0; i < num_orders; i++) {
302 struct ion_page_pool *pool;
Rebecca Schultz Zavinbff299e2012-10-02 22:43:41 -0700303 gfp_t gfp_flags = low_order_gfp_flags;
304
305 if (orders[i] > 4)
306 gfp_flags = high_order_gfp_flags;
307 pool = ion_page_pool_create(gfp_flags, orders[i]);
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700308 if (!pool)
309 goto err_create_pool;
310 heap->pools[i] = pool;
311 }
Laura Abbott5046c952013-04-18 09:40:43 -0700312 heap->heap.debug_show = ion_system_heap_debug_show;
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700313 return &heap->heap;
314err_create_pool:
315 for (i = 0; i < num_orders; i++)
316 if (heap->pools[i])
317 ion_page_pool_destroy(heap->pools[i]);
318 kfree(heap->pools);
319err_alloc_pools:
320 kfree(heap);
321 return ERR_PTR(-ENOMEM);
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700322}
323
324void ion_system_heap_destroy(struct ion_heap *heap)
325{
Rebecca Schultz Zavin943facc2012-08-06 21:37:23 -0700326 struct ion_system_heap *sys_heap = container_of(heap,
327 struct ion_system_heap,
328 heap);
329 int i;
330
331 for (i = 0; i < num_orders; i++)
332 ion_page_pool_destroy(sys_heap->pools[i]);
333 kfree(sys_heap->pools);
334 kfree(sys_heap);
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700335}
336
337static int ion_system_contig_heap_allocate(struct ion_heap *heap,
338 struct ion_buffer *buffer,
339 unsigned long len,
340 unsigned long align,
341 unsigned long flags)
342{
343 buffer->priv_virt = kzalloc(len, GFP_KERNEL);
344 if (!buffer->priv_virt)
345 return -ENOMEM;
346 return 0;
347}
348
349void ion_system_contig_heap_free(struct ion_buffer *buffer)
350{
351 kfree(buffer->priv_virt);
352}
353
354static int ion_system_contig_heap_phys(struct ion_heap *heap,
355 struct ion_buffer *buffer,
356 ion_phys_addr_t *addr, size_t *len)
357{
358 *addr = virt_to_phys(buffer->priv_virt);
359 *len = buffer->size;
360 return 0;
361}
362
Laura Abbottb14ed962012-01-30 14:18:08 -0800363struct sg_table *ion_system_contig_heap_map_dma(struct ion_heap *heap,
Rebecca Schultz Zavinb1790672012-06-14 15:08:53 -0700364 struct ion_buffer *buffer)
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700365{
Laura Abbottb14ed962012-01-30 14:18:08 -0800366 struct sg_table *table;
367 int ret;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700368
Laura Abbottb14ed962012-01-30 14:18:08 -0800369 table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
370 if (!table)
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700371 return ERR_PTR(-ENOMEM);
Laura Abbottb14ed962012-01-30 14:18:08 -0800372 ret = sg_alloc_table(table, 1, GFP_KERNEL);
373 if (ret) {
374 kfree(table);
375 return ERR_PTR(ret);
376 }
377 sg_set_page(table->sgl, virt_to_page(buffer->priv_virt), buffer->size,
378 0);
379 return table;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700380}
381
Rebecca Schultz Zavinb1790672012-06-14 15:08:53 -0700382void ion_system_contig_heap_unmap_dma(struct ion_heap *heap,
383 struct ion_buffer *buffer)
384{
385 sg_free_table(buffer->sg_table);
386 kfree(buffer->sg_table);
387}
388
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700389static struct ion_heap_ops kmalloc_ops = {
390 .allocate = ion_system_contig_heap_allocate,
391 .free = ion_system_contig_heap_free,
392 .phys = ion_system_contig_heap_phys,
393 .map_dma = ion_system_contig_heap_map_dma,
Rebecca Schultz Zavinb1790672012-06-14 15:08:53 -0700394 .unmap_dma = ion_system_contig_heap_unmap_dma,
Rebecca Schultz Zavin3df181c2012-11-15 10:43:46 -0800395 .map_kernel = ion_heap_map_kernel,
396 .unmap_kernel = ion_heap_unmap_kernel,
Laura Abbottd59c2232013-04-17 17:19:40 -0700397 .map_user = ion_heap_map_user,
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700398};
399
Laura Abbottb629a822013-04-18 09:56:04 -0700400struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *unused)
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700401{
402 struct ion_heap *heap;
403
404 heap = kzalloc(sizeof(struct ion_heap), GFP_KERNEL);
405 if (!heap)
406 return ERR_PTR(-ENOMEM);
407 heap->ops = &kmalloc_ops;
408 heap->type = ION_HEAP_TYPE_SYSTEM_CONTIG;
Rebecca Schultz Zavinc80005a2011-06-29 19:44:29 -0700409 return heap;
410}
411
412void ion_system_contig_heap_destroy(struct ion_heap *heap)
413{
414 kfree(heap);
415}
416