From: Hari Prasath Gujulan Elango <gehariprasath@ti.com>
To: <reatmon@ti.com>
Cc: <praneeth@ti.com>, <denys@konsulko.com>,
<meta-arago@lists.yoctoproject.org>, <s-kapoor@ti.com>,
<p-gupta5@ti.com>, <u-kumar1@ti.com>,
Hari Prasath Gujulan Elango <gehariprasath@ti.com>
Subject: [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
Date: Thu, 27 Aug 2026 20:37:19 +0530 [thread overview]
Message-ID: <20260827150719.821469-1-gehariprasath@ti.com> (raw)
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 +++++++++++++++++++
| 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 */
--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
next reply other threads:[~2026-08-27 15:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 15:07 Hari Prasath Gujulan Elango [this message]
2026-08-27 15:10 ` [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260827150719.821469-1-gehariprasath@ti.com \
--to=gehariprasath@ti.com \
--cc=denys@konsulko.com \
--cc=meta-arago@lists.yoctoproject.org \
--cc=p-gupta5@ti.com \
--cc=praneeth@ti.com \
--cc=reatmon@ti.com \
--cc=s-kapoor@ti.com \
--cc=u-kumar1@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.