summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-10-19 17:44:45 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-26 17:51:55 +0100
commit4ddaddfc8359f39180c15607dcd9d2fc59d9f893 (patch)
treed3d057adb1e7ce233a92ac05d8b0b4d45c72c68a
parent25a870dbd3f88d55bd228fb6e1bfe5cbda4050cd (diff)
libcamera: ipu3: Register camera controls
Register controls for the IPU3 pipeline handler. The only supported Camera control is currently the pipeline depth control. Report the minimum and maximum values the pipeline handler supports for the pipeline processing stages and report for each request the pipeline depth describing the number of processing steps the frames went through. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index af47739d..5a6ee1a8 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -12,6 +12,7 @@
#include <vector>
#include <libcamera/camera.h>
+#include <libcamera/control_ids.h>
#include <libcamera/formats.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
@@ -40,6 +41,10 @@ static constexpr unsigned int IMGU_OUTPUT_HEIGHT_ALIGN = 4;
static constexpr unsigned int IMGU_OUTPUT_WIDTH_MARGIN = 64;
static constexpr unsigned int IMGU_OUTPUT_HEIGHT_MARGIN = 32;
+static const ControlInfoMap IPU3Controls = {
+ { &controls::draft::PipelineDepth, ControlInfo(2, 3) },
+};
+
class IPU3CameraData : public CameraData
{
public:
@@ -771,6 +776,9 @@ int PipelineHandlerIPU3::registerCameras()
/* Initialize the camera properties. */
data->properties_ = cio2->sensor()->properties();
+ /* Initialze the camera controls. */
+ data->controlInfo_ = IPU3Controls;
+
/**
* \todo Dynamically assign ImgU and output devices to each
* stream and camera; as of now, limit support to two cameras
@@ -833,6 +841,7 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
return;
/* Mark the request as complete. */
+ request->metadata().set(controls::draft::PipelineDepth, 3);
pipe_->completeRequest(camera_, request);
}
@@ -858,6 +867,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)
if (request->findBuffer(&rawStream_)) {
bool isComplete = pipe_->completeBuffer(camera_, request, buffer);
if (isComplete) {
+ request->metadata().set(controls::draft::PipelineDepth, 2);
pipe_->completeRequest(camera_, request);
return;
}