[libcamera-devel] [PATCH v2 3/3] libcamera: raspberrypi: Check dma heap allocator
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Aug 28 18:11:38 CEST 2020
On 28/08/2020 16:51, Jacopo Mondi wrote:
> Check if the dmaHeap_ allocator is valid at match() time to fail
> earlier if its construction failed.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
> src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index c1451e71b587..ce43af345f53 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -904,6 +904,8 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
> return false;
>
> std::unique_ptr<RPiCameraData> data = std::make_unique<RPiCameraData>(this);
> + if (!data->dmaHeap_.isValid())
> + return false;
It feels a bit awkward the way we're returning here, but an error will
have been reported, so I think it's ok, and it's not really a fault of
this patch.
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
> /* Locate and open the unicam video streams. */
> data->unicam_[Unicam::Embedded] = RPiStream("Unicam Embedded", unicam_->getEntityByName("unicam-embedded"));
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list