All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
@ 2026-08-27 15:07 Hari Prasath Gujulan Elango
  2026-08-27 15:10 ` PRC Automation
  2026-08-27 16:51 ` Andrew Davis
  0 siblings, 2 replies; 7+ messages in thread
From: Hari Prasath Gujulan Elango @ 2026-08-27 15:07 UTC (permalink / raw)
  To: reatmon
  Cc: praneeth, denys, meta-arago, s-kapoor, p-gupta5, u-kumar1,
	Hari Prasath Gujulan Elango

Copy the TI vendor kernel dma-heap.h header, which has the
DMA_HEAP_IOCTL_EXPORT ioctl that the default linux-libc-headers
doesn't have.

Signed-off-by: Hari Prasath Gujulan Elango <gehariprasath@ti.com>
---
 .../0001-dma-heap-add-export-ioctl.patch      | 58 +++++++++++++++++++
 .../linux-libc-headers_%.bbappend             | 10 ++++
 2 files changed, 68 insertions(+)
 create mode 100644 meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-dma-heap-add-export-ioctl.patch
 create mode 100644 meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend

diff --git a/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-dma-heap-add-export-ioctl.patch b/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-dma-heap-add-export-ioctl.patch
new file mode 100644
index 00000000..e96c9ff0
--- /dev/null
+++ b/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-dma-heap-add-export-ioctl.patch
@@ -0,0 +1,58 @@
+From: Andrew Davis <afd@ti.com>
+Subject: [PATCH] dma-buf: heaps: expose DMA_HEAP_IOCTL_EXPORT uapi
+
+Mirrors ti-linux-kernel commit 8715cc31cfe8a191ade660ff787fedbadcb187d4
+("TI: HACK: dma-buf: heaps: Add Heap export from offset IOCTL"), limited
+to the include/uapi/linux/dma-heap.h hunk. The kernel already ships this
+ioctl; linux-libc-headers fetches its own independent pristine tarball
+and knows nothing about it, so userspace can't see the symbol without
+this patch.
+
+Upstream-Status: Inappropriate [TI kernel hack, not upstream]
+Signed-off-by: Andrew Davis <afd@ti.com>
+Signed-off-by: Udit Kumar <u-kumar1@ti.com>
+
+diff --git a/include/uapi/linux/dma-heap.h b/include/uapi/linux/dma-heap.h
+index a4cf716a49fa6..db749800b6c16 100644
+--- a/include/uapi/linux/dma-heap.h
++++ b/include/uapi/linux/dma-heap.h
+@@ -39,6 +39,25 @@ struct dma_heap_allocation_data {
+ 	__u64 heap_flags;
+ };
+
++/**
++ * struct dma_heap_export_data - metadata passed from userspace for export
++ * @offset:		offset from heap base
++ * @len:		size of the allocation
++ * @fd:			will be populated with a fd which provides the
++ *			handle to the allocated dma-buf
++ * @fd_flags:		file descriptor flags used when allocating
++ * @heap_flags:		flags passed to heap
++ *
++ * Provided by userspace as an argument to the ioctl
++ */
++struct dma_heap_export_data {
++	__u64 offset;
++	__u64 len;
++	__u32 fd;
++	__u32 fd_flags;
++	__u64 heap_flags;
++};
++
+ #define DMA_HEAP_IOC_MAGIC		'H'
+
+ /**
+@@ -50,4 +69,13 @@ struct dma_heap_allocation_data {
+ #define DMA_HEAP_IOCTL_ALLOC	_IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
+ 				      struct dma_heap_allocation_data)
+
++/**
++ * DOC: DMA_HEAP_IOCTL_EXPORT - allocate memory at offset
++ *
++ * Takes a dma_heap_export_data struct and returns it with the fd field
++ * populated with the dmabuf handle of the export.
++ */
++#define DMA_HEAP_IOCTL_EXPORT	_IOWR(DMA_HEAP_IOC_MAGIC, 0x1,\
++				      struct dma_heap_export_data)
++
+ #endif /* _UAPI_LINUX_DMABUF_POOL_H */
diff --git a/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend b/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend
new file mode 100644
index 00000000..7f0345ab
--- /dev/null
+++ b/meta-arago-distro/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend
@@ -0,0 +1,10 @@
+# linux-libc-headers fetches its own pristine kernel.org tarball, independent
+# of ti-linux-kernel, so it doesn't see TI's out-of-tree dma-heap ioctl even
+# though the running kernel already has it. This carries a minimal, purely
+# additive patch (no existing symbols touched) so that ioctl is visible to
+# userspace via /usr/include/linux/dma-heap.h without re-sourcing the whole
+# recipe from our kernel tree.
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
+
+SRC_URI += "file://0001-dma-heap-add-export-ioctl.patch"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-28  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 15:07 [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch Hari Prasath Gujulan Elango
2026-08-27 15:10 ` PRC Automation
2026-08-27 16:51 ` Andrew Davis
2026-08-27 16:59   ` Kumar, Udit
2026-08-27 21:08   ` Ryan Eatmon
2026-08-28  6:31     ` Hari Prasath G E
2026-08-28  3:26   ` Hari Prasath G E

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.