summaryrefslogtreecommitdiff
path: root/src/libcamera
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-06-05 10:34:17 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-06-05 15:11:45 +0300
commit48cb731d72e2bc54d3bf76eb35c6644fa2f924f2 (patch)
tree9759e4e672731444a14e87be5a2378964b5c29b1 /src/libcamera
parent9f0d88695ed6691a3e18c256d9d49862b3af6e34 (diff)
libcamera: dma_buf_allocator: Work around lack of file seals in uClibc
uClibc doesn't provide the macros defining parameters for the file sealing API. Define them manually as a work around. Fixes: ea4baaacc325 ("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src/libcamera')
-rw-r--r--src/libcamera/dma_buf_allocator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp
index d7d08e18..c06eca7d 100644
--- a/src/libcamera/dma_buf_allocator.cpp
+++ b/src/libcamera/dma_buf_allocator.cpp
@@ -127,6 +127,14 @@ DmaBufAllocator::~DmaBufAllocator() = default;
* \return True if the DmaBufAllocator is valid, false otherwise
*/
+/* uClibc doesn't provide the file sealing API. */
+#ifndef __DOXYGEN__
+#if not HAVE_FILE_SEALS
+#define F_ADD_SEALS 1033
+#define F_SEAL_SHRINK 0x0002
+#endif
+#endif
+
UniqueFD DmaBufAllocator::allocFromUDmaBuf(const char *name, std::size_t size)
{
/* Size must be a multiple of the page size. Round it up. */