From: "Andrew F. Davis" Subject: [PATCH 12/14] staging: android: ion: Declare helpers for carveout and chunk heaps Date: Fri, 11 Jan 2019 12:05:21 -0600 Message-ID: <20190111180523.27862-13-afd@ti.com> References: <20190111180523.27862-1-afd@ti.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20190111180523.27862-1-afd@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= Cc: devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Andrew F . Davis" List-Id: dri-devel@lists.freedesktop.org When enabled the helpers functions for creating carveout and chunk heaps should have declarations in the ION header. Signed-off-by: Andrew F. Davis --- drivers/staging/android/ion/ion.h | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index e291299fd35f..97b2876b165a 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -308,4 +308,37 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page); int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, int nr_to_scan); +#ifdef CONFIG_ION_CARVEOUT_HEAP +/** + * ion_carveout_heap_create + * @base: base address of carveout memory + * @size: size of carveout memory region + * + * Creates a carveout ion_heap using the passed in data + */ +struct ion_heap *ion_carveout_heap_create(phys_addr_t base, size_t size); +#else +static inline struct ion_heap *ion_carveout_heap_create(phys_addr_t base, size_t size) +{ + return ERR_PTR(-ENODEV); +} +#endif + +#ifdef CONFIG_ION_CHUNK_HEAP +/** + * ion_chunk_heap_create + * @base: base address of carveout memory + * @size: size of carveout memory region + * @chunk_size: minimum allocation granularity + * + * Creates a chunk ion_heap using the passed in data + */ +struct ion_heap *ion_chunk_heap_create(phys_addr_t base, size_t size, size_t chunk_size); +#else +static inline struct ion_heap *ion_chunk_heap_create(phys_addr_t base, size_t size, size_t chunk_size) +{ + return ERR_PTR(-ENODEV); +} +#endif + #endif /* _ION_H */ -- 2.19.1