@@ -48,7 +48,7 @@ static dev_t dma_heap_devt;
static struct class *dma_heap_class;
static DEFINE_XARRAY_ALLOC(dma_heap_minors);
-static struct dma_heap *dma_heap_find(const char* name)
+struct dma_heap *dma_heap_find(const char* name)
{
struct dma_heap *h;
@@ -64,9 +64,9 @@ static struct dma_heap *dma_heap_find(const char* name)
return NULL;
}
-static int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len,
- unsigned int fd_flags,
- unsigned int heap_flags)
+int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len,
+ unsigned int fd_flags,
+ unsigned int heap_flags)
{
if (fd_flags & ~DMA_HEAP_VALID_FD_FLAGS)
return -EINVAL;
@@ -56,4 +56,22 @@ void *dma_heap_get_drvdata(struct dma_heap *heap);
*/
struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info);
+
+
+/**
+ * dma_heap_find - Returns the registered dma_heap with the specified name
+ * @name: Name of the heap to find
+ */
+struct dma_heap *dma_heap_find(char* name);
+
+/**
+ * dma_heap_buffer_alloc - Allocate dma-buf from a dma_heap
+ * @heap: dma_heap to allocate from
+ * @len: size to allocate
+ * @fd_flags: flags to set on returned dma-buf fd
+ * @heap_flags: flags to pass to the dma heap
+ */
+int dma_heap_buffer_alloc(struct dma_heap *heap, size_t len,
+ unsigned int fd_flags,
+ unsigned int heap_flags);
#endif /* _DMA_HEAPS_H */
Really early RFC. Basically trying to provide in-kernel accessors to the DMA-BUF heaps, similar to what the ion interface provided Before we can push this patch, we need an actual in-kernel user Signed-off-by: John Stultz <john.stultz@linaro.org> --- drivers/dma-buf/dma-heap.c | 8 ++++---- include/linux/dma-heap.h | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) -- 2.17.1