* Re: [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
2026-08-27 16:51 ` Andrew Davis
@ 2026-08-27 16:59 ` Kumar, Udit
2026-08-27 21:08 ` Ryan Eatmon
2026-08-28 3:26 ` Hari Prasath G E
2 siblings, 0 replies; 7+ messages in thread
From: Kumar, Udit @ 2026-08-27 16:59 UTC (permalink / raw)
To: Andrew Davis, gehariprasath, reatmon
Cc: praneeth, denys, meta-arago, s-kapoor, p-gupta5, u-kumar1
On 8/27/2026 10:21 PM, Andrew Davis wrote:
> On 8/27/26 10:07 AM, Hari Prasath via lists.yoctoproject.org wrote:
>> 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>
>> ---
>
> https://github.com/openembedded/openembedded-core/blob/master/meta/
> recipes-kernel/linux-libc-headers/linux-libc-headers.inc#L7
That is usual problem with when uapi is getting updated
https://github.com/TexasInstruments/ti-linux-kernel/blob/ti-linux-6.18.y/include/uapi/linux/dma-heap.h#L78
Now SW stack using this ioctl will fail to compile in case of
1- using include from rootfs or
2- compiling on target itself
recommendation is understood,
thanks for suggesting alternative way out
>
>> .../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"
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
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
2 siblings, 1 reply; 7+ messages in thread
From: Ryan Eatmon @ 2026-08-27 21:08 UTC (permalink / raw)
To: Andrew Davis, gehariprasath
Cc: praneeth, denys, meta-arago, s-kapoor, p-gupta5, u-kumar1
On 8/27/2026 11:51 AM, Andrew Davis wrote:
> On 8/27/26 10:07 AM, Hari Prasath via lists.yoctoproject.org wrote:
>> 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>
>> ---
>
> https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc#L7
>
Hari, what happened to doing this like what NXP did? Install this
header into a different subdir in /usr/include?
https://github.com/nxp-imx/meta-imx/blob/wrynose-6.18.20-2.0.0/meta-imx-bsp/recipes-kernel/linux/linux-imx-headers_6.18.bb
I don't think doing it this way is going to be the right way of doing it.
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
2026-08-27 21:08 ` Ryan Eatmon
@ 2026-08-28 6:31 ` Hari Prasath G E
0 siblings, 0 replies; 7+ messages in thread
From: Hari Prasath G E @ 2026-08-28 6:31 UTC (permalink / raw)
To: Ryan Eatmon, Andrew Davis
Cc: praneeth, denys, meta-arago, s-kapoor, p-gupta5, u-kumar1
Hello Ryan,
On 8/28/2026 2:38 AM, Ryan Eatmon wrote:
>
>
> On 8/27/2026 11:51 AM, Andrew Davis wrote:
>> On 8/27/26 10:07 AM, Hari Prasath via lists.yoctoproject.org wrote:
>>> 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>
>>> ---
>>
>> https://github.com/openembedded/openembedded-core/blob/master/meta/
>> recipes-kernel/linux-libc-headers/linux-libc-headers.inc#L7
>>
>
> Hari, what happened to doing this like what NXP did? Install this
> header into a different subdir in /usr/include?
>
> https://github.com/nxp-imx/meta-imx/blob/wrynose-6.18.20-2.0.0/meta-imx-
> bsp/recipes-kernel/linux/linux-imx-headers_6.18.bb
>
> I don't think doing it this way is going to be the right way of doing it.
I did try this approach. The downside I saw was it clone's the entire
kernel source repo again which took too long. I also ended up in some
do_unpack() failures (the logs which I shared with you) so I gave up on
this approach. I have sent a new patch which ends up doing the same i.e.
it copies the needed UAPI header into /usr/include/ti/linux, same as
what NXP does.
Regards,
Hari
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-arago][scarthgap][PATCH] linux-libc-headers: add DMA_HEAP_IOCTL_EXPORT uapi patch
2026-08-27 16:51 ` Andrew Davis
2026-08-27 16:59 ` Kumar, Udit
2026-08-27 21:08 ` Ryan Eatmon
@ 2026-08-28 3:26 ` Hari Prasath G E
2 siblings, 0 replies; 7+ messages in thread
From: Hari Prasath G E @ 2026-08-28 3:26 UTC (permalink / raw)
To: Andrew Davis, reatmon
Cc: praneeth, denys, meta-arago, s-kapoor, p-gupta5, u-kumar1
Hello Andrew,
On 8/27/2026 10:21 PM, Andrew Davis wrote:
> On 8/27/26 10:07 AM, Hari Prasath via lists.yoctoproject.org wrote:
>> 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>
>> ---
>
> https://github.com/openembedded/openembedded-core/blob/master/meta/
> recipes-kernel/linux-libc-headers/linux-libc-headers.inc#L7
>
I read this note and tried even writing a separate recipe for TI vendor
kernel headers, but bitbake simply wouldn't allow me to copy to
/usr/include/linux where the linux-libc-headers is copying to. I can try
to install in a different location like /usr/include/ti/linux or
something similar. But in this case, the userspace application need to
make adjustments in their code to include it from the new location
(which is possible). I am trying it out with a build, will keep you
posted and send a new patch.
Regards,
Hari
>> .../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"
>
^ permalink raw reply [flat|nested] 7+ messages in thread