libcamera: pipeline: raspberrypi: DmaHeaps: Use UniqueFD for a file descriptor

Manages a file descriptor owned by DmaHeaps for a dma handle by
UniqueFD. Furthermore, DmaHeaps::alloc() creates a new file
descriptor and the returned file descriptor is owned by a caller.
This also clarifies it by changing the returned value to UniqueFD.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Hirokazu Honda
2021-06-10 16:50:26 +09:00
committed by Laurent Pinchart
parent 415ac12399
commit 1af788a8fb
3 changed files with 18 additions and 22 deletions
@@ -1393,7 +1393,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)
/* Allocate the lens shading table via dmaHeap and pass to the IPA. */
if (!lsTable_.isValid()) {
lsTable_ = dmaHeap_.alloc("ls_grid", ipa::RPi::MaxLsGridSize);
lsTable_ = FileDescriptor(dmaHeap_.alloc("ls_grid", ipa::RPi::MaxLsGridSize));
if (!lsTable_.isValid())
return -ENOMEM;