libcamera v0.2.0
Supporting cameras in Linux since 2019
|
Helper class for dma-heap allocations. More...
Public Types | |
enum class | DmaHeapFlag { Cma = 1 << 0 , System = 1 << 1 } |
Type of the dma-heap. More... | |
using | DmaHeapFlags = Flags< DmaHeapFlag > |
A bitwise combination of DmaHeap::DmaHeapFlag values. | |
Public Member Functions | |
DmaHeap (DmaHeapFlags flags=DmaHeapFlag::Cma) | |
Construct a DmaHeap that owns a CMA or system dma-heap file descriptor. | |
~DmaHeap () | |
Destroy the DmaHeap instance. | |
bool | isValid () const |
Check if the DmaHeap instance is valid. | |
UniqueFD | alloc (const char *name, std::size_t size) |
Allocate a dma-buf from the DmaHeap. | |
Helper class for dma-heap allocations.
|
strong |
libcamera::DmaHeap::DmaHeap | ( | DmaHeapFlags | flags = DmaHeapFlag::Cma | ) |
Construct a DmaHeap that owns a CMA or system dma-heap file descriptor.
[in] | flags | The type(s) of the dma-heap(s) to allocate from |
By default flags are set to DmaHeap::DmaHeapFlag::Cma. The constructor goes through the internal list of possible names of the CMA and system dma-heap devices until the dma-heap device of the requested type is successfully opened. If more than one dma-heap type is specified in flags the CMA heap is tried first. If it fails to open any dma-heap device an invalid DmaHeap object is constructed. A valid DmaHeap object owns a wrapped dma-heap file descriptor.
Please check the new DmaHeap object with DmaHeap::isValid before using it.
|
default |
UniqueFD libcamera::DmaHeap::alloc | ( | const char * | name, |
std::size_t | size | ||
) |
|
inline |