aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/ion/exynos/exynos_ion.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/ion/exynos/exynos_ion.c')
-rw-r--r--drivers/gpu/ion/exynos/exynos_ion.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/drivers/gpu/ion/exynos/exynos_ion.c b/drivers/gpu/ion/exynos/exynos_ion.c
index a574a32..100f055 100644
--- a/drivers/gpu/ion/exynos/exynos_ion.c
+++ b/drivers/gpu/ion/exynos/exynos_ion.c
@@ -416,7 +416,8 @@ static int ion_exynos_contig_heap_allocate(struct ion_heap *heap,
{
buffer->priv_phys = cma_alloc(exynos_ion_dev, NULL, len, align);
- if (0) {
+#ifdef CONFIG_ION_EXYNOS_CONTIGHEAP_DEBUG
+ if (1) {
/* Print debug MSG */
struct cma_info mem_info;
struct rb_node *n=NULL;
@@ -431,24 +432,28 @@ static int ion_exynos_contig_heap_allocate(struct ion_heap *heap,
pr_err("%s: get cma info failed\n", __func__);
return (int)buffer->priv_phys;
}
- printk("[ION_EXYNOS_CONTIG_HEAP] addr: %x ~ %x, total size: 0x%x, free size: 0x%x\n",
- mem_info.lower_bound, mem_info.upper_bound,
- mem_info.total_size, mem_info.free_size);
- for(n = rb_first(&ion_exynos->buffers); n; n = rb_next(n)) {
- struct ion_buffer *buffer = rb_entry(n, struct ion_buffer, node);
+ printk(KERN_INFO "[ION_EXYNOS_CONTIG_HEAP] addr: %x ~ %x, "
+ "total size: 0x%x, free size: 0x%x\n",
+ mem_info.lower_bound, mem_info.upper_bound,
+ mem_info.total_size, mem_info.free_size);
+ for (n = rb_first(&ion_exynos->buffers); n; n = rb_next(n)) {
+ struct ion_buffer *buffer =
+ rb_entry(n, struct ion_buffer, node);
if (buffer->heap->type == ION_HEAP_TYPE_EXYNOS_CONTIG) {
- printk("[%d] 0x%x ~ 0x%x, size:0x%x\n",
- buffer_cnt, (unsigned int)buffer->priv_phys,
- (unsigned int)buffer->priv_phys+buffer->size, buffer->size);
+ printk(KERN_INFO "[%d] 0x%x ~ 0x%x, size:0x%x\n",
+ buffer_cnt, (unsigned int)buffer->priv_phys,
+ (unsigned int)buffer->priv_phys+buffer->size,
+ buffer->size);
size += buffer->size;
buffer_cnt++;
}
}
- printk("[%d] 0x%x ~ 0x%x, size:0x%x\n",
+ printk(KERN_INFO "[%d] 0x%x ~ 0x%x, size:0x%x\n",
buffer_cnt, (unsigned int)curr_phy,
(unsigned int)curr_phy+curr_size, curr_size);
- printk("usage size: 0x%x\n", size);
+ printk(KERN_INFO "usage size: 0x%x\n", size);
}
+#endif
if (IS_ERR_VALUE(buffer->priv_phys)) {
struct cma_info mem_info;
@@ -482,16 +487,24 @@ static int ion_exynos_contig_heap_allocate(struct ion_heap *heap,
}
buffer->flags = flags;
+ printk(KERN_INFO "[ION] alloc: 0x%x\n",
+ (unsigned int)buffer->priv_phys);
return 0;
}
static void ion_exynos_contig_heap_free(struct ion_buffer *buffer)
{
- if (0)
- printk("free addr: 0x%x\n", (unsigned int)buffer->priv_phys);
+ int ret = 0;
+#ifdef CONFIG_ION_EXYNOS_CONTIGHEAP_DEBUG
+ if (1)
+ printk(KERN_INFO "free addr: 0x%x\n",
+ (unsigned int)buffer->priv_phys);
+#endif
- cma_free(buffer->priv_phys);
+ ret = cma_free(buffer->priv_phys);
+ printk(KERN_INFO "[ION] free: 0x%x, [0x%x]\n",
+ (unsigned int)buffer->priv_phys, ret);
}
static int ion_exynos_contig_heap_phys(struct ion_heap *heap,
@@ -1083,6 +1096,9 @@ static int exynos_ion_probe(struct platform_device *pdev)
int err;
int i;
+ if (!pdata)
+ return -ENOTTY;
+
num_heaps = pdata->nr;
heaps = kzalloc(sizeof(struct ion_heap *) * pdata->nr, GFP_KERNEL);