diff --git a/drivers/gpu/ion/ion_cp_heap.c b/drivers/gpu/ion/ion_cp_heap.c index e46c62345c0..942c29c3272 100644 --- a/drivers/gpu/ion/ion_cp_heap.c +++ b/drivers/gpu/ion/ion_cp_heap.c @@ -2,7 +2,7 @@ * drivers/gpu/ion/ion_cp_heap.c * * Copyright (C) 2011 Google, Inc. - * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -310,6 +310,7 @@ ion_phys_addr_t ion_cp_allocate(struct ion_heap *heap, { unsigned long offset; unsigned long secure_allocation = flags & ION_SECURE; + unsigned long force_contig = flags & ION_FORCE_CONTIGUOUS; struct ion_cp_heap *cp_heap = container_of(heap, struct ion_cp_heap, heap); @@ -322,7 +323,8 @@ ion_phys_addr_t ion_cp_allocate(struct ion_heap *heap, return ION_CP_ALLOCATE_FAIL; } - if (!secure_allocation && cp_heap->disallow_non_secure_allocation) { + if (!force_contig && !secure_allocation && + cp_heap->disallow_non_secure_allocation) { mutex_unlock(&cp_heap->lock); pr_debug("%s: non-secure allocation disallowed from this heap\n", __func__); diff --git a/include/linux/msm_ion.h b/include/linux/msm_ion.h index 09c584b22ea..d51acf72ded 100644 --- a/include/linux/msm_ion.h +++ b/include/linux/msm_ion.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * Copyright (c) 2012-2013, Code Aurora Forum. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -72,6 +72,13 @@ enum cp_mem_usage { */ #define ION_SECURE (1 << ION_HEAP_ID_RESERVED) +/** + * Flag for clients to force contiguous memort allocation + * + * Use of this flag is carefully monitored! + */ +#define ION_FORCE_CONTIGUOUS (1 << 30) + /** * Macro should be used with ion_heap_ids defined above. */