Files
external_libcamera/src/libcamera/pipeline/raspberrypi/dma_heaps.h
T
Jacopo Mondi b5f0848d0f libcamera: raspberrypi: dmaheaps: Add isValid()
Add isValid() method to verify the allocator device has been open
correctly.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-28 18:20:11 +02:00

33 lines
669 B
C++

/* 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();
bool isValid() const { return dmaHeapHandle_ > -1; }
FileDescriptor alloc(const char *name, std::size_t size);
private:
int dmaHeapHandle_;
};
} /* namespace RPi */
} /* namespace libcamera */
#endif /* __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ */