[libcamera-devel,v2,08/13] libcamera: ipu3: Register camera controls
diff mbox series

Message ID 20201020180534.36855-9-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: Introduce draft controls
Related show

Commit Message

Jacopo Mondi Oct. 20, 2020, 6:05 p.m. UTC
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.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Kieran Bingham Oct. 21, 2020, 1:03 p.m. UTC | #1
Hi Jacopo,

On 20/10/2020 19:05, Jacopo Mondi wrote:
> 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.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index af47739d8d4f..4cbd7ba3007b 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:
> @@ -770,6 +775,8 @@ int PipelineHandlerIPU3::registerCameras()
>  
>  		/* Initialize the camera properties. */
>  		data->properties_ = cio2->sensor()->properties();

I'd have a blank line here for my eyes to clearly see the comment lines,
but that's completely optional.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> +		/* Initialze the camera controls. */
> +		data->controlInfo_ = IPU3Controls;
>  
>  		/**
>  		 * \todo Dynamically assign ImgU and output devices to each
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index af47739d8d4f..4cbd7ba3007b 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:
@@ -770,6 +775,8 @@  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