[{"id":23640,"web_url":"https://patchwork.libcamera.org/comment/23640/","msgid":"<CAHW6GYK=3UKwrtAn=GV3iFPx9qiP12RQDcSwpTvYNoDkZdQ1Dg@mail.gmail.com>","date":"2022-06-28T08:45:15","subject":"Re: [libcamera-devel] [PATCH v3 3/3] pipeline: raspberrypi:\n\tAdvertise ScalerCrop from the pipeline handler","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch. LGTM!\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nDavid\n\nOn Wed, 22 Jun 2022 at 11:21, Naushir Patuck via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> The ScalerCrop control is handled directly by the pipeline handler. Remove the\n> control from the IPA's static ControlInfoMap, and let the pipeline handler add\n> it to the ControlInfoMap advertised to the application, ensuring the limits\n> are set appropriately based on the current sensor mode.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 4596f2babcea..66a84b1dfb97 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -941,7 +941,15 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>         data->properties_.set(properties::SensorSensitivity, result.modeSensitivity);\n>\n>         /* Update the controls that the Raspberry Pi IPA can handle. */\n> -       data->controlInfo_ = result.controlInfo;\n> +       ControlInfoMap::Map ctrlMap;\n> +       for (auto const &c : result.controlInfo)\n> +               ctrlMap.emplace(c.first, c.second);\n> +\n> +       /* Add the ScalerCrop control limits based on the current mode. */\n> +       ctrlMap.emplace(&controls::ScalerCrop,\n> +                       ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize)));\n> +\n> +       data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n>\n>         /* Setup the Video Mux/Bridge entities. */\n>         for (auto &[device, link] : data->bridgeDevices_) {\n> --\n> 2.25.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 98935BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Jun 2022 08:45:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE54C65635;\n\tTue, 28 Jun 2022 10:45:27 +0200 (CEST)","from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E0B4A6559A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jun 2022 10:45:26 +0200 (CEST)","by mail-ej1-x633.google.com with SMTP id ge10so24250753ejb.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jun 2022 01:45:26 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656405927;\n\tbh=A6ruQ96ZMvzXNHENUI7wC6/Gz0f9Ao0ieyBHaUTAAek=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=t67M7NOQ2eb/7xKyhZOvwXsgufWQSxUhOvoxn0X+xKeBMIuDT1heGDFxy6jx8nr4w\n\t1cfPobL57ASxMCB+L9kE22V/zA9KRCAmRI4DzcoMSYs4y6Mez/L3obxYpzTvwtyOda\n\treaIyLJXXrZqw3jDKrIFPUxOQSH6fMf/pisSiug0p80CPAVm5jYkxS/l+n4/Bn/OHM\n\tONHgXHzK/CbuWVkKMJQBfeV+v9a3d2Nr8C7aWwob5xh/5AdestWtcKScmuW29/MiJr\n\tuFCR3KlesLrbR4DilSTqAa28XtgNHUa5VmSj+CT86+OvGefUjkmCzOWAvyc3ErEXmS\n\t2o68caPyp8wxQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=06BmC2z6syP1qLlPei47e/qsE9nh85JKAwYuxVlriYI=;\n\tb=qvvFpFgD4bD7mYD45rSLL1ee51RcGn6v+m/X3jogkQ4QfepVFFrZeVTFgVR3AKy0Zm\n\tNP9CYRb9IdwHvh1yllNBG4AXQiLIqq7dJnAf8+UUnjN4m8aQJz/gao+Shhe4Db/aefwW\n\tC/vEY6fzu55gM44wNa2q5bo6T0z9u7GZ4YGpkfN0ZeTGZXIo2ns406pIKyHi/udSla/0\n\tCFvCd5zqnJJgLDNL9KCmTl/q//Rh/B4NKxtCzYqKbW+cfG38CO7WG7UgFb53QUuAiHtl\n\tR+XNhI4viVxXDGn1uwz0oTNxcrUSjrjnCs3aTIoyGVjv9hCIOI1QgW8ag9RPX/pj0veg\n\tEVSg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"qvvFpFgD\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=06BmC2z6syP1qLlPei47e/qsE9nh85JKAwYuxVlriYI=;\n\tb=PolhhnqmGaNDZB+ydqgFbh8g5cJCUeUJ2xZsP7bBUhh2Te/5Rcn4J4hN0cOmgnBRVu\n\t9tEOKtWfAH6bgtwYqG11UA9BVXVAixsCiwI9yHTagMiO+J5HAUdfd17ZaGPhJbIPK7Ts\n\tKxHGlhuIpZQLQD5KZ/RAh4MEIVhySn/OkZk0M/N61nTaGPsyc7OWW/OnEUgBQjH8XLYN\n\tvhenHvpOiGUP+otefF8QU5iDTrD3nnjczRAKgJvt+m2t1RV5jF23xz2cQlydgxthZ4dT\n\tZKXywcCDVsyGidjtKIyNyjWhqVo5LwCXkyJonmgbry47sxEzCUVg4I7R0W20q8NQ/cEN\n\teAQQ==","X-Gm-Message-State":"AJIora8skh1g0HR0pdSAuDmhW9fS1g3UKjvcnJrbQTjEbAy7zOLVMu4r\n\thAJV8a1i7MtL7drCCgt2XjcnC0nEFf+g8q+d5vDiOEL4F1sKig==","X-Google-Smtp-Source":"AGRyM1tU3S5ZZGOl0xh0Q5xIYJ0lkn/eZWA7zL+ICJAshFt+XKZRtbb+8Tb0+U1Mzdji5znB9dY0G42s9q1mGMtQNec=","X-Received":"by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id\n\tnc1-20020a1709071c0100b006f426920e23mr16411456ejc.243.1656405926427;\n\tTue, 28 Jun 2022 01:45:26 -0700 (PDT)","MIME-Version":"1.0","References":"<20220622102047.22492-1-naush@raspberrypi.com>\n\t<20220622102047.22492-4-naush@raspberrypi.com>","In-Reply-To":"<20220622102047.22492-4-naush@raspberrypi.com>","Date":"Tue, 28 Jun 2022 09:45:15 +0100","Message-ID":"<CAHW6GYK=3UKwrtAn=GV3iFPx9qiP12RQDcSwpTvYNoDkZdQ1Dg@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3 3/3] pipeline: raspberrypi:\n\tAdvertise ScalerCrop from the pipeline handler","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23662,"web_url":"https://patchwork.libcamera.org/comment/23662/","msgid":"<165650717927.2049236.8551171677130205661@Monstersaurus>","date":"2022-06-29T12:52:59","subject":"Re: [libcamera-devel] [PATCH v3 3/3] pipeline: raspberrypi:\n\tAdvertise ScalerCrop from the pipeline handler","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2022-06-22 11:20:47)\n> The ScalerCrop control is handled directly by the pipeline handler. Remove the\n> control from the IPA's static ControlInfoMap, and let the pipeline handler add\n> it to the ControlInfoMap advertised to the application, ensuring the limits\n> are set appropriately based on the current sensor mode.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 4596f2babcea..66a84b1dfb97 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -941,7 +941,15 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>         data->properties_.set(properties::SensorSensitivity, result.modeSensitivity);\n>  \n>         /* Update the controls that the Raspberry Pi IPA can handle. */\n> -       data->controlInfo_ = result.controlInfo;\n> +       ControlInfoMap::Map ctrlMap;\n> +       for (auto const &c : result.controlInfo)\n> +               ctrlMap.emplace(c.first, c.second);\n\nSorry - I thought I'd handled this patch already.\n\nYes, I see my concerns about emplace here were misfounded, as it's a new\nlist each time - so it's fine for now.\n\nA more defined mechanism to update them might be beneficial, but it's\ninternal so can be handled later.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n\n> +\n> +       /* Add the ScalerCrop control limits based on the current mode. */\n> +       ctrlMap.emplace(&controls::ScalerCrop,\n> +                       ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize)));\n> +\n> +       data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n>  \n>         /* Setup the Video Mux/Bridge entities. */\n>         for (auto &[device, link] : data->bridgeDevices_) {\n> -- \n> 2.25.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 2D7C7BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jun 2022 12:53:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5EA0C65635;\n\tWed, 29 Jun 2022 14:53:03 +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 036C460412\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 14:53:01 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 76FCD3D7;\n\tWed, 29 Jun 2022 14:53:01 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656507183;\n\tbh=8QtMOl+6FMxX5LT3QQun376PH9Uj6k3jeYEplv10qKA=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=24EroXSui3nQO6XcfteDyn0Sh0dLcSZk3+RfOxb/Gl7YRTjMRB7gSL8ssAGnv6lqn\n\td2EavCnlLYmGCHcOjJs6v1nVpjntbJY10+Hk2k9MOLRCUSWL6m63UYtF/YVYwG6JYl\n\tB2RRbNMf/SoH+44U4qINHrw7Nw9RiUs5AiLoOOms7Y6fcTruuE+f/JPgMbbjqTqBm2\n\ta23uK9ynLWtP2k05CcAmqlY9HMZoz6awnMqR4aKeJatCDeK4d1euZgVfVphWyukuW+\n\t/BM75QLz6sC3oXwUBEDWK+RjVo0vbMzeFNTOR6a7zxKHHknTayYwmfvTB3o6iABb95\n\tR9nL5iK+J+Zug==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656507181;\n\tbh=8QtMOl+6FMxX5LT3QQun376PH9Uj6k3jeYEplv10qKA=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=rt66B0NhTjr7f11b9rV2C8JReGdYNLKi75li9MNQNRC2U1dnTkE7JATdToextmaVc\n\tk0fqsYk8OU2EUlBJBykJhT7tCxAV4hTmTiV6ldiIjw70nmcYXYWVIPai7f+esD2exv\n\te3Bymdvl1kHax9+PCc2FUKwEQF32zNYKEZrmOlB0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rt66B0Nh\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220622102047.22492-4-naush@raspberrypi.com>","References":"<20220622102047.22492-1-naush@raspberrypi.com>\n\t<20220622102047.22492-4-naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 29 Jun 2022 13:52:59 +0100","Message-ID":"<165650717927.2049236.8551171677130205661@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v3 3/3] pipeline: raspberrypi:\n\tAdvertise ScalerCrop from the pipeline handler","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]