[v1,6/7] pipeline: rpi: Pass ISP output index into platformSetIspCrop()
diff mbox series

Message ID 20240808102346.13065-7-naush@raspberrypi.com
State Superseded, archived
Headers show
Series
  • Raspberry Pi: Add controls::rpi::ScalerCrops
Related show

Commit Message

Naushir Patuck Aug. 8, 2024, 10:23 a.m. UTC
At this point, the index is unused, but will be in a future commit where
we can set different crops on each ISP output.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-
 src/libcamera/pipeline/rpi/common/pipeline_base.h   | 2 +-
 src/libcamera/pipeline/rpi/vc4/vc4.cpp              | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart Aug. 28, 2024, 5:04 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Thu, Aug 08, 2024 at 11:23:45AM +0100, Naushir Patuck wrote:
> At this point, the index is unused, but will be in a future commit where
> we can set different crops on each ISP output.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

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

> ---
>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-
>  src/libcamera/pipeline/rpi/common/pipeline_base.h   | 2 +-
>  src/libcamera/pipeline/rpi/vc4/vc4.cpp              | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> index 412e71648231..a6ea4e9c47dd 100644
> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> @@ -1317,7 +1317,7 @@ void CameraData::applyScalerCrop(const ControlList &controls)
>  
>  		if (ispCrop != cropParams.ispCrop) {
>  			cropParams.ispCrop = ispCrop;
> -			platformSetIspCrop(ispCrop);
> +			platformSetIspCrop(cropParams.ispIndex, ispCrop);
>  		}
>  	}
>  }
> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h
> index 0ccfa4e82e86..7959d874dd6f 100644
> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h
> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h
> @@ -83,7 +83,7 @@ public:
>  
>  	Rectangle scaleIspCrop(const Rectangle &ispCrop) const;
>  	void applyScalerCrop(const ControlList &controls);
> -	virtual void platformSetIspCrop(const Rectangle &ispCrop) = 0;
> +	virtual void platformSetIspCrop(unsigned int index, const Rectangle &ispCrop) = 0;
>  
>  	void cameraTimeout();
>  	void frameStarted(uint32_t sequence);
> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> index ffc45653daf1..04fb3c066baf 100644
> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> @@ -109,7 +109,7 @@ public:
>  	Config config_;
>  
>  private:
> -	void platformSetIspCrop(const Rectangle &ispCrop) override
> +	void platformSetIspCrop([[maybe_unused]] unsigned int index, const Rectangle &ispCrop) override
>  	{
>  		Rectangle crop = ispCrop;
>  		isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);
> @@ -707,7 +707,7 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi
>  	Size size = unicamFormat.size.boundedToAspectRatio(maxSize);
>  	Rectangle ispCrop = size.centeredTo(Rectangle(unicamFormat.size).center());
>  
> -	platformSetIspCrop(ispCrop);
> +	platformSetIspCrop(0, ispCrop);
>  	/*
>  	 * Set the scaler crop to the value we are using (scaled to native sensor
>  	 * coordinates).

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 412e71648231..a6ea4e9c47dd 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -1317,7 +1317,7 @@  void CameraData::applyScalerCrop(const ControlList &controls)
 
 		if (ispCrop != cropParams.ispCrop) {
 			cropParams.ispCrop = ispCrop;
-			platformSetIspCrop(ispCrop);
+			platformSetIspCrop(cropParams.ispIndex, ispCrop);
 		}
 	}
 }
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h
index 0ccfa4e82e86..7959d874dd6f 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.h
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h
@@ -83,7 +83,7 @@  public:
 
 	Rectangle scaleIspCrop(const Rectangle &ispCrop) const;
 	void applyScalerCrop(const ControlList &controls);
-	virtual void platformSetIspCrop(const Rectangle &ispCrop) = 0;
+	virtual void platformSetIspCrop(unsigned int index, const Rectangle &ispCrop) = 0;
 
 	void cameraTimeout();
 	void frameStarted(uint32_t sequence);
diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index ffc45653daf1..04fb3c066baf 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -109,7 +109,7 @@  public:
 	Config config_;
 
 private:
-	void platformSetIspCrop(const Rectangle &ispCrop) override
+	void platformSetIspCrop([[maybe_unused]] unsigned int index, const Rectangle &ispCrop) override
 	{
 		Rectangle crop = ispCrop;
 		isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);
@@ -707,7 +707,7 @@  int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi
 	Size size = unicamFormat.size.boundedToAspectRatio(maxSize);
 	Rectangle ispCrop = size.centeredTo(Rectangle(unicamFormat.size).center());
 
-	platformSetIspCrop(ispCrop);
+	platformSetIspCrop(0, ispCrop);
 	/*
 	 * Set the scaler crop to the value we are using (scaled to native sensor
 	 * coordinates).