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

Jacopo Mondi jacopo at jmondi.org
Fri Aug 28 18:00:36 CEST 2020


On Fri, Aug 28, 2020 at 05:51:35PM +0200, Jacopo Mondi wrote:
> 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; }

Maybe bool ?

>  	FileDescriptor alloc(const char *name, std::size_t size);
>
>  private:
> --
> 2.28.0
>


More information about the libcamera-devel mailing list