summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi/dma_heaps.h
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2020-07-15 10:39:11 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-17 16:36:28 +0300
commit3e7aa49344ad5233f644703559898572b57f9613 (patch)
tree579857871a6bff875f06579b5faf3910c24c90ce /src/libcamera/pipeline/raspberrypi/dma_heaps.h
parent3c02a808e8934a0c2d875d5585403ce0a09d7c93 (diff)
libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tables
Remove use of vcsm allocations and replace with dma heap allocations. The pipeline handler now passes the fd of the allocation over to the IPA instead of the raw pointer. Also use libcamera::FileDescriptor for fd lifetime management. This commit must be built alongside the accompanying BCM2835 ISP kernel driver changes at https://github.com/raspberrypi/linux/pull/3715. Otherwise a mismatch will cause undefined behavior. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi/dma_heaps.h')
-rw-r--r--src/libcamera/pipeline/raspberrypi/dma_heaps.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
new file mode 100644
index 00000000..ae6be113
--- /dev/null
+++ b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Raspberry Pi (Trading) Limited
+ *
+ * dma_heaps.h - Helper class for dma-heap allocations.
+ */
+#ifndef __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__
+#define __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__
+
+#include <libcamera/file_descriptor.h>
+
+namespace libcamera {
+
+namespace RPi {
+
+class DmaHeap
+{
+public:
+ DmaHeap();
+ ~DmaHeap();
+ FileDescriptor alloc(const char *name, std::size_t size);
+
+private:
+ int dmaHeapHandle_;
+};
+
+} /* namespace RPi */
+
+} /* namespace libcamera */
+
+#endif /* __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ */