Skip to content

Commit 2eebbdb

Browse files
johnstultz-worksumitsemwal
authored andcommitted
dma-buf: heaps: Fix the name used when exporting dmabufs to be the actual heap name
By default dma_buf_export() sets the exporter name to be KBUILD_MODNAME. Unfortunately this may not be identical to the string used as the heap name (ie: "system" vs "system_heap"). This can cause some minor confusion with tooling, and there is the future potential where multiple heap types may be exported by the same module (but would all have the same name). So to avoid all this, set the exporter exp_name to the heap name. Cc: Daniel Vetter <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Liam Mark <[email protected]> Cc: Chris Goldsworthy <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Brian Starkey <[email protected]> Cc: Hridya Valsaraju <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Sandeep Patil <[email protected]> Cc: Daniel Mentz <[email protected]> Cc: Ørjan Eide <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Ezequiel Garcia <[email protected]> Cc: Simon Ser <[email protected]> Cc: James Jones <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: John Stultz <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 98cd02d commit 2eebbdb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

drivers/dma-buf/heaps/cma_heap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
336336
buffer->pagecount = pagecount;
337337

338338
/* create the dmabuf */
339+
exp_info.exp_name = dma_heap_get_name(heap);
339340
exp_info.ops = &cma_heap_buf_ops;
340341
exp_info.size = buffer->len;
341342
exp_info.flags = fd_flags;

drivers/dma-buf/heaps/system_heap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap,
390390
}
391391

392392
/* create the dmabuf */
393+
exp_info.exp_name = dma_heap_get_name(heap);
393394
exp_info.ops = &system_heap_buf_ops;
394395
exp_info.size = buffer->len;
395396
exp_info.flags = fd_flags;

0 commit comments

Comments
 (0)