[libcamera-devel] [PATCH 07/13] libcamera: pipeline: rkisp1: Set the crop rectangle

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Aug 20 17:12:48 CEST 2020


Hi Niklas,

Thank you for the patch.

On Thu, Aug 13, 2020 at 02:52:40AM +0200, Niklas Söderlund wrote:
> Changing resolutions back and forth can provoke the crop rectangle to go
> out of sync, set it as port of format configuration.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 8e0f6db5faa96928..59614a9f470b7802 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -632,6 +632,11 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
>  	if (ret < 0)
>  		return ret;
>  
> +	Rectangle rect(0, 0, format.size);
> +	ret = isp_->setSelection(0, V4L2_SEL_TGT_CROP, &rect);
> +	if (ret < 0)
> +		return ret;
> +

I wonder why this is necessary, as we set the format on the ISP sink
pad, and that should reset the crop rectangle. Isn't it a driver bug ?

Still, this doesn't hurt, so

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

>  	LOG(RkISP1, Debug) << "ISP input pad configured with " << format.toString();
>  
>  	/* YUYV8_2X8 is required on the ISP source path pad for YUV output. */

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list