[libcamera-devel] [PATCH v2 2/3] libcamera: raspberrypi: dmaheaps: Add isValid()

Jacopo Mondi jacopo at jmondi.org
Fri Aug 28 17:51:35 CEST 2020


Add isValid() method to verify the allocator device has been open
correctly.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/pipeline/raspberrypi/dma_heaps.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
index ae6be1135f17..119abd26ed31 100644
--- a/src/libcamera/pipeline/raspberrypi/dma_heaps.h
+++ b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
@@ -18,6 +18,7 @@ class DmaHeap
 public:
 	DmaHeap();
 	~DmaHeap();
+	int isValid() const { return dmaHeapHandle_ > -1; }
 	FileDescriptor alloc(const char *name, std::size_t size);
 
 private:
-- 
2.28.0



More information about the libcamera-devel mailing list