[7/7] pipeline: rkisp1: Add ScalerMaximumCrop property
diff mbox series

Message ID 20241120085753.1993436-8-stefan.klug@ideasonboard.com
State Superseded
Headers show
Series
  • rkisp1: Fix aspect ratio and ScalerCrop
Related show

Commit Message

Stefan Klug Nov. 20, 2024, 8:57 a.m. UTC
The ScalerMaximumCrop property holds the biggest allowed ScalerCrop
value. Add it to the rkisp1.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jacopo Mondi Nov. 21, 2024, 3:43 p.m. UTC | #1
Hi Stefan

On Wed, Nov 20, 2024 at 09:57:46AM +0100, Stefan Klug wrote:
> The ScalerMaximumCrop property holds the biggest allowed ScalerCrop
> value. Add it to the rkisp1.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index c2ce38b1c253..647b5754bd55 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -24,6 +24,7 @@
>  #include <libcamera/control_ids.h>
>  #include <libcamera/formats.h>
>  #include <libcamera/framebuffer.h>
> +#include <libcamera/property_ids.h>
>  #include <libcamera/request.h>
>  #include <libcamera/stream.h>
>  #include <libcamera/transform.h>
> @@ -870,7 +871,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
>  				 * coordinates.
>  				 */
>  				dewarperSensorCrop_ = outputCrop.mappedBetween(inputCrop,
> -									       ipaConfig.sensorInfo.analogCrop);
> +									       sensorInfo.analogCrop);

Why this change ?

>  			}
>  		} else if (hasSelfPath_) {
>  			ret = selfPath_.configure(cfg, format);
> @@ -1247,6 +1248,7 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)
>  		controls[&controls::ScalerCrop] = ControlInfo(min,
>  							      max,
>  							      max);
> +		data->properties_.set(properties::ScalerCropMaximum, max);

What about platforms without dewarper ?

>  		activeCrop_ = max;
>  	}
>
> --
> 2.43.0
>
Stefan Klug Nov. 25, 2024, 2:58 p.m. UTC | #2
Hi Jacopo,

Thank you for the review.

On Thu, Nov 21, 2024 at 04:43:37PM +0100, Jacopo Mondi wrote:
> Hi Stefan
> 
> On Wed, Nov 20, 2024 at 09:57:46AM +0100, Stefan Klug wrote:
> > The ScalerMaximumCrop property holds the biggest allowed ScalerCrop
> > value. Add it to the rkisp1.
> >
> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> > ---
> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > index c2ce38b1c253..647b5754bd55 100644
> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > @@ -24,6 +24,7 @@
> >  #include <libcamera/control_ids.h>
> >  #include <libcamera/formats.h>
> >  #include <libcamera/framebuffer.h>
> > +#include <libcamera/property_ids.h>
> >  #include <libcamera/request.h>
> >  #include <libcamera/stream.h>
> >  #include <libcamera/transform.h>
> > @@ -870,7 +871,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
> >  				 * coordinates.
> >  				 */
> >  				dewarperSensorCrop_ = outputCrop.mappedBetween(inputCrop,
> > -									       ipaConfig.sensorInfo.analogCrop);
> > +									       sensorInfo.analogCrop);
> 
> Why this change ?

Thanks for spotting. That belongs to 

[PATCH 5/7] pipeline: rkisp1: Reorder sensorInfo collection code

I corrected that in v2.

> 
> >  			}
> >  		} else if (hasSelfPath_) {
> >  			ret = selfPath_.configure(cfg, format);
> > @@ -1247,6 +1248,7 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)
> >  		controls[&controls::ScalerCrop] = ControlInfo(min,
> >  							      max,
> >  							      max);
> > +		data->properties_.set(properties::ScalerCropMaximum, max);
> 
> What about platforms without dewarper ?

Atm there won't be scaler crop support. You mean the rockchips using
resizer?

Best regards,
Stefan

> 
> >  		activeCrop_ = max;
> >  	}
> >
> > --
> > 2.43.0
> >

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index c2ce38b1c253..647b5754bd55 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -24,6 +24,7 @@ 
 #include <libcamera/control_ids.h>
 #include <libcamera/formats.h>
 #include <libcamera/framebuffer.h>
+#include <libcamera/property_ids.h>
 #include <libcamera/request.h>
 #include <libcamera/stream.h>
 #include <libcamera/transform.h>
@@ -870,7 +871,7 @@  int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
 				 * coordinates.
 				 */
 				dewarperSensorCrop_ = outputCrop.mappedBetween(inputCrop,
-									       ipaConfig.sensorInfo.analogCrop);
+									       sensorInfo.analogCrop);
 			}
 		} else if (hasSelfPath_) {
 			ret = selfPath_.configure(cfg, format);
@@ -1247,6 +1248,7 @@  int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)
 		controls[&controls::ScalerCrop] = ControlInfo(min,
 							      max,
 							      max);
+		data->properties_.set(properties::ScalerCropMaximum, max);
 		activeCrop_ = max;
 	}