[libcamera-devel] libcamera: ipu3: Initialize V|H flip support
diff mbox series

Message ID 20210223135331.2711706-1-jacopo@jmondi.org
State Accepted
Commit f8a70a8a745d83c956b32ec28dc2488e099e2486
Headers show
Series
  • [libcamera-devel] libcamera: ipu3: Initialize V|H flip support
Related show

Commit Message

Jacopo Mondi Feb. 23, 2021, 1:53 p.m. UTC
The flag that is used to record if the sensor driver supports the H/V flip
controls is initialized at camera creation time, but it was not
initialized by the IPU3Camera constructor, resulting in erroneous
values that might break capture for sensor that do not support flipping.

Fix this by initializing the flag in the class constructor.

Fixes: 6c4ce7de30c8 ("libcamera: ipu3: Add rotation to ipu3 pipeline")
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.30.0

Comments

Niklas Söderlund Feb. 23, 2021, 2:11 p.m. UTC | #1
Hi Jacopo,

Thanks for your patch.

On 2021-02-23 14:53:31 +0100, Jacopo Mondi wrote:
> The flag that is used to record if the sensor driver supports the H/V flip
> controls is initialized at camera creation time, but it was not
> initialized by the IPU3Camera constructor, resulting in erroneous
> values that might break capture for sensor that do not support flipping.
> 
> Fix this by initializing the flag in the class constructor.
> 
> Fixes: 6c4ce7de30c8 ("libcamera: ipu3: Add rotation to ipu3 pipeline")
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index daace29f71ea..2838196a4b21 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -56,7 +56,7 @@ class IPU3CameraData : public CameraData
>  {
>  public:
>  	IPU3CameraData(PipelineHandler *pipe)
> -		: CameraData(pipe), exposureTime_(0)
> +		: CameraData(pipe), exposureTime_(0), supportsFlips_(false)
>  	{
>  	}
> 
> --
> 2.30.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Feb. 23, 2021, 3:51 p.m. UTC | #2
Hi Jacopo,

Thank you for the patch.

On Tue, Feb 23, 2021 at 02:53:31PM +0100, Jacopo Mondi wrote:
> The flag that is used to record if the sensor driver supports the H/V flip
> controls is initialized at camera creation time, but it was not
> initialized by the IPU3Camera constructor, resulting in erroneous
> values that might break capture for sensor that do not support flipping.
> 
> Fix this by initializing the flag in the class constructor.
> 
> Fixes: 6c4ce7de30c8 ("libcamera: ipu3: Add rotation to ipu3 pipeline")
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Good catch!

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

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index daace29f71ea..2838196a4b21 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -56,7 +56,7 @@ class IPU3CameraData : public CameraData
>  {
>  public:
>  	IPU3CameraData(PipelineHandler *pipe)
> -		: CameraData(pipe), exposureTime_(0)
> +		: CameraData(pipe), exposureTime_(0), supportsFlips_(false)
>  	{
>  	}
>
Fabian Wüthrich Feb. 23, 2021, 7:42 p.m. UTC | #3
Hi Jacopo

I missed that one. Thanks for fixing it.

Tested-by: Fabian Wüthrich <me@fabwu.ch>

On 23.02.21 14:53, Jacopo Mondi wrote:
> The flag that is used to record if the sensor driver supports the H/V flip
> controls is initialized at camera creation time, but it was not
> initialized by the IPU3Camera constructor, resulting in erroneous
> values that might break capture for sensor that do not support flipping.
> 
> Fix this by initializing the flag in the class constructor.
> 
> Fixes: 6c4ce7de30c8 ("libcamera: ipu3: Add rotation to ipu3 pipeline")
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index daace29f71ea..2838196a4b21 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -56,7 +56,7 @@ class IPU3CameraData : public CameraData
>  {
>  public:
>  	IPU3CameraData(PipelineHandler *pipe)
> -		: CameraData(pipe), exposureTime_(0)
> +		: CameraData(pipe), exposureTime_(0), supportsFlips_(false)
>  	{
>  	}
> 
> --
> 2.30.0
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index daace29f71ea..2838196a4b21 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -56,7 +56,7 @@  class IPU3CameraData : public CameraData
 {
 public:
 	IPU3CameraData(PipelineHandler *pipe)
-		: CameraData(pipe), exposureTime_(0)
+		: CameraData(pipe), exposureTime_(0), supportsFlips_(false)
 	{
 	}