[PATCH v1 1/7] controls: rpi: Add a vendor rpi::ScalerCrops control

Jacopo Mondi jacopo.mondi at ideasonboard.com
Wed Aug 28 11:09:55 CEST 2024


Hi Naush

On Thu, Aug 08, 2024 at 11:23:40AM GMT, Naushir Patuck wrote:
> Add a vendor control rpi::ScalerCrops that is analogous to the current
> core::ScalerCrop, but can apply a different crop to each configured
> stream.
>
> This control takes a span of Rectangle structures - the order of
> rectangles must match the order of streams configured by the application.
>
> Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
> ---
>  src/ipa/rpi/common/ipa_base.cpp    |  2 ++
>  src/libcamera/control_ids_rpi.yaml | 15 +++++++++++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> index ee3848b54f21..463f6d384c9e 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -71,6 +71,7 @@ const ControlInfoMap::Map ipaControls{
>  	{ &controls::HdrMode, ControlInfo(controls::HdrModeValues) },
>  	{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
>  	{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
> +	{ &controls::rpi::ScalerCrops, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },

Can this be registered only in the pisp IPA ? In this way you won't
see the control on vc4 platforms, and you can safely keep the code
handling it in pipeline_base, but it will only be exercized on pi5

>  	{ &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) },
>  	{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
>  	{ &controls::rpi::StatsOutputEnable, ControlInfo(false, true, false) },
> @@ -1070,6 +1071,7 @@ void IpaBase::applyControls(const ControlList &controls)
>  			break;
>  		}
>
> +		case controls::rpi::SCALER_CROPS:
>  		case controls::SCALER_CROP: {
>  			/* We do nothing with this, but should avoid the warning below. */
>  			break;
> diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml
> index cb097f887e16..3d4a305dd8f5 100644
> --- a/src/libcamera/control_ids_rpi.yaml
> +++ b/src/libcamera/control_ids_rpi.yaml
> @@ -26,4 +26,19 @@ controls:
>
>          \sa StatsOutputEnable
>
> +  - ScalerCrops:
> +      type: Rectangle
> +      size: [n]
> +      description: |
> +        An array of rectangles, where each singular value has identical functionality
> +        to the ScalerCrop control. This control allows the Raspberry Pi pipeline
> +        handler to control individual scaler crops per output stream.
> +
> +        The order of rectangles passed into the control must match the order of
> +        streams configured by the application.
> +
> +        Note that using different crop rectangles for each output stream is only
> +        applicable on the Pi5/PiSP platform.
> +
> +        \sa ScalerCrop
>  ...
> --
> 2.34.1
>


More information about the libcamera-devel mailing list