[{"id":31474,"web_url":"https://patchwork.libcamera.org/comment/31474/","msgid":"<spdqbsrvc46kiqluinlq5q2rjetkby7kazvwm47lqb3j7egl6z@od5gbvo5k2lf>","date":"2024-10-01T06:13:09","subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Mon, Sep 30, 2024 at 03:14:09PM GMT, Naushir Patuck wrote:\n> Add a vendor control rpi::ScalerCrops that is analogous to the current\n> core::ScalerCrop, but can apply a different crop to each configured\n> stream.\n>\n> This control takes a span of Rectangle structures - the order of\n> rectangles must match the order of streams configured by the application.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp    | 14 ++++++++++++++\n>  src/libcamera/control_ids_rpi.yaml | 21 +++++++++++++++++++++\n>  2 files changed, 35 insertions(+)\n>\n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index ee3848b54f21..d408cdb74255 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -96,6 +96,15 @@ const ControlInfoMap::Map ipaAfControls{\n>  \t{ &controls::LensPosition, ControlInfo(0.0f, 32.0f, 1.0f) }\n>  };\n>\n> +/* Platform specific controls */\n> +const std::map<const std::string, ControlInfoMap::Map> platformControls {\n> +\t{ \"pisp\",\n> +\t  {\n> +\t\t{ &controls::rpi::ScalerCrops, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }\n> +\t  }\n> +\t},\n> +};\n\nI wonder if this won't be better placed in the forthcoming pisp.c but\nI don't see a ControlInfoMap in vc4.cpp, so maybe you plan to place\nplatform specific controls on ipa_base.cpp ?\n\n> +\n>  } /* namespace */\n>\n>  LOG_DEFINE_CATEGORY(IPARPI)\n> @@ -159,6 +168,10 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams &params, Ini\n>  \tif (lensPresent_)\n>  \t\tctrlMap.merge(ControlInfoMap::Map(ipaAfControls));\n>\n> +\tauto platformCtrlsIt = platformControls.find(controller_.getTarget());\n> +\tif (platformCtrlsIt != platformControls.end())\n> +\t\tctrlMap.merge(ControlInfoMap::Map(platformCtrlsIt->second));\n> +\n>  \tmonoSensor_ = params.sensorInfo.cfaPattern == properties::draft::ColorFilterArrangementEnum::MONO;\n>  \tif (!monoSensor_)\n>  \t\tctrlMap.merge(ControlInfoMap::Map(ipaColourControls));\n> @@ -1070,6 +1083,7 @@ void IpaBase::applyControls(const ControlList &controls)\n>  \t\t\tbreak;\n>  \t\t}\n>\n> +\t\tcase controls::rpi::SCALER_CROPS:\n>  \t\tcase controls::SCALER_CROP: {\n>  \t\t\t/* We do nothing with this, but should avoid the warning below. */\n>  \t\t\tbreak;\n> diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\n> index cb097f887e16..a0fc1cd897b5 100644\n> --- a/src/libcamera/control_ids_rpi.yaml\n> +++ b/src/libcamera/control_ids_rpi.yaml\n> @@ -26,4 +26,25 @@ controls:\n>\n>          \\sa StatsOutputEnable\n>\n> +  - ScalerCrops:\n> +      type: Rectangle\n> +      size: [n]\n> +      description: |\n> +        An array of rectangles, where each singular value has identical\n> +        functionality to the ScalerCrop control. This control allows the\n> +        Raspberry Pi pipeline handler to control individual scaler crops per\n> +        output stream.\n> +\n> +        The order of rectangles passed into the control must match the order of\n> +        streams configured by the application. The pipeline handler will only\n> +        configure crop retangles up-to the number of output streams configured.\n> +        All subsequent rectangles passed into this control are ignored by the\n> +        pipeline handler.\n> +\n> +        Note that using different crop rectangles for each output stream with\n> +        this control is only applicable on the Pi5/PiSP platform. This control\n> +        should also be considered temporary/draft and will be replaced with\n> +        official libcamera API support for per-stream controls in the future.\n> +\n> +        \\sa ScalerCrop\n\nFine to have a vendor control for this\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n>  ...\n> --\n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CA548BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Oct 2024 06:13:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9F9D963512;\n\tTue,  1 Oct 2024 08:13:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 683EB62C91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Oct 2024 08:13:14 +0200 (CEST)","from ideasonboard.com (unknown [5.179.150.95])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 672152E3;\n\tTue,  1 Oct 2024 08:11:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ekJraYTZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727763102;\n\tbh=iB9A/0zRETx0PjdXLUiPmIQzANh2MfW7kkno/JZZ8Zs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ekJraYTZwG5fd4Ic95zNb7iM9/q54ue0dAdy8iml/IDpkI7IDMJPyBY2BDnkuq/xt\n\t/k8qM9b6459q8/tjPRaLNf8mhr3fsadYyfk0lIouriuUJB3SyC8ETZZz+7ja459VQO\n\ts7+TG/+HZyN/MAy10RAA71+u4OsqUV1HWWmkefb4=","Date":"Tue, 1 Oct 2024 08:13:09 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","Message-ID":"<spdqbsrvc46kiqluinlq5q2rjetkby7kazvwm47lqb3j7egl6z@od5gbvo5k2lf>","References":"<20240930141415.8857-1-naush@raspberrypi.com>\n\t<20240930141415.8857-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240930141415.8857-2-naush@raspberrypi.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31495,"web_url":"https://patchwork.libcamera.org/comment/31495/","msgid":"<CAEmqJPp4UR2fOr-MWiBQ7fu==8kqNXaxOyBqx0a5xYFMDGdhdA@mail.gmail.com>","date":"2024-10-01T11:05:45","subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nThanks for the feedback.\n\nOn Tue, 1 Oct 2024 at 07:13, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote:\n>\n> Hi Naush\n>\n> On Mon, Sep 30, 2024 at 03:14:09PM GMT, Naushir Patuck wrote:\n> > Add a vendor control rpi::ScalerCrops that is analogous to the current\n> > core::ScalerCrop, but can apply a different crop to each configured\n> > stream.\n> >\n> > This control takes a span of Rectangle structures - the order of\n> > rectangles must match the order of streams configured by the application.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/ipa/rpi/common/ipa_base.cpp    | 14 ++++++++++++++\n> >  src/libcamera/control_ids_rpi.yaml | 21 +++++++++++++++++++++\n> >  2 files changed, 35 insertions(+)\n> >\n> > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> > index ee3848b54f21..d408cdb74255 100644\n> > --- a/src/ipa/rpi/common/ipa_base.cpp\n> > +++ b/src/ipa/rpi/common/ipa_base.cpp\n> > @@ -96,6 +96,15 @@ const ControlInfoMap::Map ipaAfControls{\n> >       { &controls::LensPosition, ControlInfo(0.0f, 32.0f, 1.0f) }\n> >  };\n> >\n> > +/* Platform specific controls */\n> > +const std::map<const std::string, ControlInfoMap::Map> platformControls {\n> > +     { \"pisp\",\n> > +       {\n> > +             { &controls::rpi::ScalerCrops, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }\n> > +       }\n> > +     },\n> > +};\n>\n> I wonder if this won't be better placed in the forthcoming pisp.c but\n> I don't see a ControlInfoMap in vc4.cpp, so maybe you plan to place\n> platform specific controls on ipa_base.cpp ?\n\nGood question - I can do it if you think it's more appropriate?\n\nThe reason I did it in ipa_base.cpp was because I liked that all\ngeneral/hw specific controls were listed in the same place.\n\nRegards,\nNaush\n\n>\n> > +\n> >  } /* namespace */\n> >\n> >  LOG_DEFINE_CATEGORY(IPARPI)\n> > @@ -159,6 +168,10 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams &params, Ini\n> >       if (lensPresent_)\n> >               ctrlMap.merge(ControlInfoMap::Map(ipaAfControls));\n> >\n> > +     auto platformCtrlsIt = platformControls.find(controller_.getTarget());\n> > +     if (platformCtrlsIt != platformControls.end())\n> > +             ctrlMap.merge(ControlInfoMap::Map(platformCtrlsIt->second));\n> > +\n> >       monoSensor_ = params.sensorInfo.cfaPattern == properties::draft::ColorFilterArrangementEnum::MONO;\n> >       if (!monoSensor_)\n> >               ctrlMap.merge(ControlInfoMap::Map(ipaColourControls));\n> > @@ -1070,6 +1083,7 @@ void IpaBase::applyControls(const ControlList &controls)\n> >                       break;\n> >               }\n> >\n> > +             case controls::rpi::SCALER_CROPS:\n> >               case controls::SCALER_CROP: {\n> >                       /* We do nothing with this, but should avoid the warning below. */\n> >                       break;\n> > diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\n> > index cb097f887e16..a0fc1cd897b5 100644\n> > --- a/src/libcamera/control_ids_rpi.yaml\n> > +++ b/src/libcamera/control_ids_rpi.yaml\n> > @@ -26,4 +26,25 @@ controls:\n> >\n> >          \\sa StatsOutputEnable\n> >\n> > +  - ScalerCrops:\n> > +      type: Rectangle\n> > +      size: [n]\n> > +      description: |\n> > +        An array of rectangles, where each singular value has identical\n> > +        functionality to the ScalerCrop control. This control allows the\n> > +        Raspberry Pi pipeline handler to control individual scaler crops per\n> > +        output stream.\n> > +\n> > +        The order of rectangles passed into the control must match the order of\n> > +        streams configured by the application. The pipeline handler will only\n> > +        configure crop retangles up-to the number of output streams configured.\n> > +        All subsequent rectangles passed into this control are ignored by the\n> > +        pipeline handler.\n> > +\n> > +        Note that using different crop rectangles for each output stream with\n> > +        this control is only applicable on the Pi5/PiSP platform. This control\n> > +        should also be considered temporary/draft and will be replaced with\n> > +        official libcamera API support for per-stream controls in the future.\n> > +\n> > +        \\sa ScalerCrop\n>\n> Fine to have a vendor control for this\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>\n> Thanks\n>   j\n>\n> >  ...\n> > --\n> > 2.34.1\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D80B6BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Oct 2024 11:06:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A7AC5618D7;\n\tTue,  1 Oct 2024 13:06:16 +0200 (CEST)","from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com\n\t[IPv6:2607:f8b0:4864:20::b2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E48760553\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Oct 2024 13:06:14 +0200 (CEST)","by mail-yb1-xb2d.google.com with SMTP id\n\t3f1490d57ef6-e115c8be0deso657487276.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 01 Oct 2024 04:06:14 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"gQ4oI3c6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1727780773; x=1728385573;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=SoMgDyXtJUrCqbEP1j5SzyWYXNlsv81oUylvqVs8L/0=;\n\tb=gQ4oI3c6AxTV2PkwKHDMB2CMLboyTZc/TRk0z90MOrs9yY/d2FtIwl6HSRHZsZH7+j\n\trqyrlKW6PFEqyOYiCPuqmiXH9wpHrgjujMBbuOq2sA8P3pnU+XxodRkZrqwovXzLDvkr\n\tTWITY4os4/WT7jnPh91b52v/gFn2Bw2HcRVPgLnUQwqJbk1qmr1SlSChUm0R0BL96BHp\n\tVU6U1PdpVyxQ1oCDE1yVNT9xjs9kccNxemOmFD1NETWJWI1gQSMaoXmj6tuf4s32/Bw0\n\tbcF+3iQr73ylON2KxSH0EtlXhl1ymB6bo1iXQSixPnpen17RsTYwup6YnwUAVamhnNP/\n\tW+lg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727780773; x=1728385573;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=SoMgDyXtJUrCqbEP1j5SzyWYXNlsv81oUylvqVs8L/0=;\n\tb=R3Zb+bR+hiDp9nkx8F/9lfe4nVusn2PHBl1f9PQ+yiriYAazy8ecv+fDzobdlHXYzn\n\tiX6gtTC/zhKKn9MRXCpzLgAI6aQEQ+U6O4OoX0scQMgCoqdr6IPZWtZhrxVK9hGuTDxN\n\tFwzDTc5w74FMg+cQaEjUtZ715PhSC64vnE3BubzevvZRMwZe4S49x4Gm66dKScYiTtFp\n\tUspPB3UTGm0tGvG/FzJ5I6iXxAEZrbqmsTU56RGJlES1Idad8ixQBXm/Z27w0nXEJ0DB\n\tUz5/VcvWWZakKTdvic562kNsWleVuqcPLCJib2TozA7+zdJR2KgfNeYPmW1O8z+b+Ftb\n\t62gg==","X-Gm-Message-State":"AOJu0YyMYFAB5l6RtAVfRABYFe+TUjOr9MEsWt3kgD3SZJsRQXdntSFO\n\tH0EkMFbWRCuqWk7HkiET+Nn6sJ3rBo4ByrSBx4I6o6HEaalQojz2mGYFP1bs8D5bzVD+YY6jIsc\n\t6wf2iLQNf/114ll2vAdv+NKrvzmpKRfyA+I1Pc/p77ioj+j+j","X-Google-Smtp-Source":"AGHT+IHavhjhWI4a66EowJ5QUmD9I9NTTajpSd3NdSXXl8X4YLTXa+/X96iEkcTgGGc7csABNbRUOTGWm8S2mkGtxus=","X-Received":"by 2002:a81:fe03:0:b0:6e2:1b45:d0a4 with SMTP id\n\t00721157ae682-6e258ea3ba5mr28428957b3.10.1727780773007;\n\tTue, 01 Oct 2024 04:06:13 -0700 (PDT)","MIME-Version":"1.0","References":"<20240930141415.8857-1-naush@raspberrypi.com>\n\t<20240930141415.8857-2-naush@raspberrypi.com>\n\t<spdqbsrvc46kiqluinlq5q2rjetkby7kazvwm47lqb3j7egl6z@od5gbvo5k2lf>","In-Reply-To":"<spdqbsrvc46kiqluinlq5q2rjetkby7kazvwm47lqb3j7egl6z@od5gbvo5k2lf>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 1 Oct 2024 12:05:45 +0100","Message-ID":"<CAEmqJPp4UR2fOr-MWiBQ7fu==8kqNXaxOyBqx0a5xYFMDGdhdA@mail.gmail.com>","Subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31501,"web_url":"https://patchwork.libcamera.org/comment/31501/","msgid":"<c4hfhxuohgyxrrc5yn4q6d3y7sbrgbuo3xenfiaee4c5avzszp@frm5wfftcwpk>","date":"2024-10-01T11:27:05","subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Tue, Oct 01, 2024 at 12:05:45PM GMT, Naushir Patuck wrote:\n> Hi Jacopo,\n>\n> Thanks for the feedback.\n>\n> On Tue, 1 Oct 2024 at 07:13, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote:\n> >\n> > Hi Naush\n> >\n> > On Mon, Sep 30, 2024 at 03:14:09PM GMT, Naushir Patuck wrote:\n> > > Add a vendor control rpi::ScalerCrops that is analogous to the current\n> > > core::ScalerCrop, but can apply a different crop to each configured\n> > > stream.\n> > >\n> > > This control takes a span of Rectangle structures - the order of\n> > > rectangles must match the order of streams configured by the application.\n> > >\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > ---\n> > >  src/ipa/rpi/common/ipa_base.cpp    | 14 ++++++++++++++\n> > >  src/libcamera/control_ids_rpi.yaml | 21 +++++++++++++++++++++\n> > >  2 files changed, 35 insertions(+)\n> > >\n> > > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> > > index ee3848b54f21..d408cdb74255 100644\n> > > --- a/src/ipa/rpi/common/ipa_base.cpp\n> > > +++ b/src/ipa/rpi/common/ipa_base.cpp\n> > > @@ -96,6 +96,15 @@ const ControlInfoMap::Map ipaAfControls{\n> > >       { &controls::LensPosition, ControlInfo(0.0f, 32.0f, 1.0f) }\n> > >  };\n> > >\n> > > +/* Platform specific controls */\n> > > +const std::map<const std::string, ControlInfoMap::Map> platformControls {\n> > > +     { \"pisp\",\n> > > +       {\n> > > +             { &controls::rpi::ScalerCrops, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }\n> > > +       }\n> > > +     },\n> > > +};\n> >\n> > I wonder if this won't be better placed in the forthcoming pisp.c but\n> > I don't see a ControlInfoMap in vc4.cpp, so maybe you plan to place\n> > platform specific controls on ipa_base.cpp ?\n>\n> Good question - I can do it if you think it's more appropriate?\n>\n\nIt's up to you to decide whatever makes maintaining the two IPAs\nsimpler.\n\n> The reason I did it in ipa_base.cpp was because I liked that all\n> general/hw specific controls were listed in the same place.\n>\n\nThat's fine then ;)\n\n> Regards,\n> Naush\n>\n> >\n> > > +\n> > >  } /* namespace */\n> > >\n> > >  LOG_DEFINE_CATEGORY(IPARPI)\n> > > @@ -159,6 +168,10 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams &params, Ini\n> > >       if (lensPresent_)\n> > >               ctrlMap.merge(ControlInfoMap::Map(ipaAfControls));\n> > >\n> > > +     auto platformCtrlsIt = platformControls.find(controller_.getTarget());\n> > > +     if (platformCtrlsIt != platformControls.end())\n> > > +             ctrlMap.merge(ControlInfoMap::Map(platformCtrlsIt->second));\n> > > +\n> > >       monoSensor_ = params.sensorInfo.cfaPattern == properties::draft::ColorFilterArrangementEnum::MONO;\n> > >       if (!monoSensor_)\n> > >               ctrlMap.merge(ControlInfoMap::Map(ipaColourControls));\n> > > @@ -1070,6 +1083,7 @@ void IpaBase::applyControls(const ControlList &controls)\n> > >                       break;\n> > >               }\n> > >\n> > > +             case controls::rpi::SCALER_CROPS:\n> > >               case controls::SCALER_CROP: {\n> > >                       /* We do nothing with this, but should avoid the warning below. */\n> > >                       break;\n> > > diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\n> > > index cb097f887e16..a0fc1cd897b5 100644\n> > > --- a/src/libcamera/control_ids_rpi.yaml\n> > > +++ b/src/libcamera/control_ids_rpi.yaml\n> > > @@ -26,4 +26,25 @@ controls:\n> > >\n> > >          \\sa StatsOutputEnable\n> > >\n> > > +  - ScalerCrops:\n> > > +      type: Rectangle\n> > > +      size: [n]\n> > > +      description: |\n> > > +        An array of rectangles, where each singular value has identical\n> > > +        functionality to the ScalerCrop control. This control allows the\n> > > +        Raspberry Pi pipeline handler to control individual scaler crops per\n> > > +        output stream.\n> > > +\n> > > +        The order of rectangles passed into the control must match the order of\n> > > +        streams configured by the application. The pipeline handler will only\n> > > +        configure crop retangles up-to the number of output streams configured.\n> > > +        All subsequent rectangles passed into this control are ignored by the\n> > > +        pipeline handler.\n> > > +\n> > > +        Note that using different crop rectangles for each output stream with\n> > > +        this control is only applicable on the Pi5/PiSP platform. This control\n> > > +        should also be considered temporary/draft and will be replaced with\n> > > +        official libcamera API support for per-stream controls in the future.\n> > > +\n> > > +        \\sa ScalerCrop\n> >\n> > Fine to have a vendor control for this\n> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> >\n> > Thanks\n> >   j\n> >\n> > >  ...\n> > > --\n> > > 2.34.1\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 45416C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Oct 2024 11:27:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 646B06351F;\n\tTue,  1 Oct 2024 13:27:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8E3C618D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Oct 2024 13:27:14 +0200 (CEST)","from ideasonboard.com (unknown [5.179.150.95])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 337261083;\n\tTue,  1 Oct 2024 13:25:38 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"B4+iYPCD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727781938;\n\tbh=tSsBJNRO3mYW6K/x8fNMKeLmKGj/h1QkqWUUs0wFov0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=B4+iYPCDkXXe64g7C9zMN7XuzC0xGN6NYXpm319bN/SwpBDjGKHKZr/mz6CDUd2ax\n\tlwJF9gUbbpvLy+kliks6ePHzSAu/v53wquaGfKAUD7obgCBjitPyXg8xrNK2+Zs5XQ\n\tmoqGwa7YG9TgtUH/VADLBjaTHBbQWMRspPn5phiU=","Date":"Tue, 1 Oct 2024 13:27:05 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/7] controls: rpi: Add a vendor rpi::ScalerCrops\n\tcontrol","Message-ID":"<c4hfhxuohgyxrrc5yn4q6d3y7sbrgbuo3xenfiaee4c5avzszp@frm5wfftcwpk>","References":"<20240930141415.8857-1-naush@raspberrypi.com>\n\t<20240930141415.8857-2-naush@raspberrypi.com>\n\t<spdqbsrvc46kiqluinlq5q2rjetkby7kazvwm47lqb3j7egl6z@od5gbvo5k2lf>\n\t<CAEmqJPp4UR2fOr-MWiBQ7fu==8kqNXaxOyBqx0a5xYFMDGdhdA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPp4UR2fOr-MWiBQ7fu==8kqNXaxOyBqx0a5xYFMDGdhdA@mail.gmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]