summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2012-01-31 09:40:30 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2012-07-18 12:05:47 +0530
commitb233444fb6577998e107ce8b99f0643f181aa6ca (patch)
treeda021bd47c9270c8882aa7a19f858073d55006e7 /drivers/gpu
parent2e3f15c959f1514cc387c27fa5a089ee279bd30c (diff)
ion: Add reserve function to ion
Rather than requiring each platform call memblock_remove or reserve from the board file, add this to ion Change-Id: Ie418a692c13e9e0cfe93ecc83d253d3ce860fc83 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/ion/ion.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index da84e2431920..e0d684da4280 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -22,6 +22,7 @@
#include <linux/anon_inodes.h>
#include <linux/ion.h>
#include <linux/list.h>
+#include <linux/memblock.h>
#include <linux/miscdevice.h>
#include <linux/export.h>
#include <linux/mm.h>
@@ -1151,3 +1152,19 @@ struct ion_client *ion_client_get_file(int fd)
fput(f);
return client;
}
+
+void __init ion_reserve(struct ion_platform_data *data)
+{
+ int i, ret;
+
+ for (i = 0; i < data->nr; i++) {
+ if (data->heaps[i].size == 0)
+ continue;
+ ret = memblock_reserve(data->heaps[i].base,
+ data->heaps[i].size);
+ if (ret)
+ pr_err("memblock reserve of %x@%lx failed\n",
+ data->heaps[i].size,
+ data->heaps[i].base);
+ }
+}