@@ -190,6 +190,11 @@ void *dma_heap_get_drvdata(struct dma_heap *heap)
return heap->priv;
}
+const char *dma_heap_get_name(struct dma_heap *heap)
+{
+ return heap->name;
+}
+
struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
{
struct dma_heap *heap, *h, *err_ret;
@@ -30,6 +30,7 @@ struct dma_buf *heap_helper_export_dmabuf(struct heap_helper_buffer *buffer,
{
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
+ exp_info.exp_name = dma_heap_get_name(buffer->heap);
exp_info.ops = &heap_helper_ops;
exp_info.size = buffer->size;
exp_info.flags = fd_flags;
@@ -50,6 +50,8 @@ struct dma_heap_export_info {
*/
void *dma_heap_get_drvdata(struct dma_heap *heap);
+const char *dma_heap_get_name(struct dma_heap *heap);
+
/**
* dma_heap_add - adds a heap to dmabuf heaps
* @exp_info: information needed to register this heap
Currently the heap helper uses DEFINE_DMA_BUF_EXPORT_INFO, which uses KBUILD_MODNAME for the dma_buf_export_info.exp_name. This effectively makes all dma-bufs exported by the heap helper as coming from "heap-helpers", instead of the actual heap name (cma, system, etc). Fix this by adding a dma-heap name getter, and then setting dma_buf_export_info.exp_name. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> --- drivers/dma-buf/dma-heap.c | 5 +++++ drivers/dma-buf/heaps/heap-helpers.c | 1 + include/linux/dma-heap.h | 2 ++ 3 files changed, 8 insertions(+)