summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rpi/vc4/dma_heaps.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/rpi/vc4/dma_heaps.h')
-rw-r--r--src/libcamera/pipeline/rpi/vc4/dma_heaps.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/rpi/vc4/dma_heaps.h b/src/libcamera/pipeline/rpi/vc4/dma_heaps.h
new file mode 100644
index 00000000..0a4a8d86
--- /dev/null
+++ b/src/libcamera/pipeline/rpi/vc4/dma_heaps.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Raspberry Pi Ltd
+ *
+ * dma_heaps.h - Helper class for dma-heap allocations.
+ */
+
+#pragma once
+
+#include <stddef.h>
+
+#include <libcamera/base/unique_fd.h>
+
+namespace libcamera {
+
+namespace RPi {
+
+class DmaHeap
+{
+public:
+ DmaHeap();
+ ~DmaHeap();
+ bool isValid() const { return dmaHeapHandle_.isValid(); }
+ UniqueFD alloc(const char *name, std::size_t size);
+
+private:
+ UniqueFD dmaHeapHandle_;
+};
+
+} /* namespace RPi */
+
+} /* namespace libcamera */