[libcamera-devel,v2,2/2] libcamera: pipeline: raspberrypi: Update ControlInfos after sensor format change
diff mbox series

Message ID 20210406104050.23814-3-david.plowman@raspberrypi.com
State Superseded
Headers show
Series
  • Fix CameraSensor::sensorInfo by updating VBLANK ControlInfo
Related show

Commit Message

David Plowman April 6, 2021, 10:40 a.m. UTC
The Raspberry Pi pipeline handler does not update the sensor format
using CameraSensor::setFormat, so it must manually force the update of
the associated ControlInfos.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Kieran Bingham April 13, 2021, 9:36 p.m. UTC | #1
Hi David,

On 06/04/2021 11:40, David Plowman wrote:
> The Raspberry Pi pipeline handler does not update the sensor format
> using CameraSensor::setFormat, so it must manually force the update of
> the associated ControlInfos.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index f22e286e..bbcc15ec 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -608,6 +608,12 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
>  	if (ret)
>  		return ret;
>  
> +	/*
> +	 * The control ranges associated with the sensor may need updating
> +	 * after a format change.
> +	 */
> +	data->sensor_->updateControlInfos();
> +

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

>  	LOG(RPI, Info) << "Sensor: " << camera->id()
>  		       << " - Selected mode: " << sensorFormat.toString();
>  
>
Naushir Patuck April 14, 2021, 8:51 a.m. UTC | #2
Hi David,

Thank you for your work.

On Tue, 6 Apr 2021 at 11:41, David Plowman <david.plowman@raspberrypi.com>
wrote:

> The Raspberry Pi pipeline handler does not update the sensor format
> using CameraSensor::setFormat, so it must manually force the update of
> the associated ControlInfos.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>

---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index f22e286e..bbcc15ec 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -608,6 +608,12 @@ int PipelineHandlerRPi::configure(Camera *camera,
> CameraConfiguration *config)
>         if (ret)
>                 return ret;
>
> +       /*
> +        * The control ranges associated with the sensor may need updating
> +        * after a format change.
> +        */
> +       data->sensor_->updateControlInfos();
> +
>         LOG(RPI, Info) << "Sensor: " << camera->id()
>                        << " - Selected mode: " << sensorFormat.toString();
>
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>
Laurent Pinchart May 4, 2021, 12:18 p.m. UTC | #3
Hi David,

Thank you for the patch.

On Tue, Apr 06, 2021 at 11:40:50AM +0100, David Plowman wrote:
> The Raspberry Pi pipeline handler does not update the sensor format
> using CameraSensor::setFormat, so it must manually force the update of
> the associated ControlInfos.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index f22e286e..bbcc15ec 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -608,6 +608,12 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
>  	if (ret)
>  		return ret;
>  
> +	/*
> +	 * The control ranges associated with the sensor may need updating
> +	 * after a format change.

With a

	 * \todo Use the CameraSensor::setFormat() API

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +	 */
> +	data->sensor_->updateControlInfos();
> +
>  	LOG(RPI, Info) << "Sensor: " << camera->id()
>  		       << " - Selected mode: " << sensorFormat.toString();
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index f22e286e..bbcc15ec 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -608,6 +608,12 @@  int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
 	if (ret)
 		return ret;
 
+	/*
+	 * The control ranges associated with the sensor may need updating
+	 * after a format change.
+	 */
+	data->sensor_->updateControlInfos();
+
 	LOG(RPI, Info) << "Sensor: " << camera->id()
 		       << " - Selected mode: " << sensorFormat.toString();