[{"id":23741,"web_url":"https://patchwork.libcamera.org/comment/23741/","msgid":"<CAHW6GYKRiPehkQ72n4Bsu-OaCh3PqMz1FfZ93ix=g3UZCiZT1w@mail.gmail.com>","date":"2022-07-05T13:45:46","subject":"Re: [libcamera-devel] [PATCH v1] pipeline: raspberrypi: Fix\n\tincorrect advertising of ScalerCrop","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 fix!\n\nOn Tue, 5 Jul 2022 at 14:41, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> The controls::ScalerCrop in the ControlInfoMap was advertised based on the ISP\n> output Rectangle. This is incorrect, it needs to be set based on the sensor\n> output Rectangle. Fix this.\n>\n> Additionally, do not use emplace to be consistent with the other controls set\n> in the ControlInfoMap.\n>\n> Fixes: 9dacde0d651d (pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler)\n> Reported-by: David Plowman <david.plowman@raspberrypi.com>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 66a84b1dfb97..d1ecc50af3b9 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -946,8 +946,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\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> +       ctrlMap[&controls::ScalerCrop] =\n> +               ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.analogCrop.size()));\n\nActually (and really sorry only to notice this now), I wonder if the\nispMinCropSize needs scaling up to native pixel units?\n\nDavid\n\n>\n>         data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n>\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 5D032BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Jul 2022 13:45:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA5166330C;\n\tTue,  5 Jul 2022 15:45:58 +0200 (CEST)","from mail-ej1-x635.google.com (mail-ej1-x635.google.com\n\t[IPv6:2a00:1450:4864:20::635])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A6EB61FB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Jul 2022 15:45:57 +0200 (CEST)","by mail-ej1-x635.google.com with SMTP id g26so21735257ejb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Jul 2022 06:45:57 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657028758;\n\tbh=+krya6zwIeALd4x/wJhjHpzUYFV47St8Q4ubpq+R1Rg=;\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=MiFFmbkVx3ub0LF5Tm0aQJTW7vgHvTlYMDjKJoyDpjeN/dGsYflB5fLfWpafN0Ulm\n\t3W30RW3hrTb5LgXeEwi9X7wSHcXsOPfHA4D1t8TOz0zmw2Wn48S7AZ0i4K0OO7D8+d\n\t9gKo7CeM6FfyCPxqJw4/jtTuKMEaBrgRKFWnyEPTkyJUiDrtiPemPNt2Oa1leG/N39\n\twCekVeFnVCzIJkVAoJiW16XZkrWTbra9/T+jTlPVxHHmX4DN61Or5OPvQBVPVOgxMl\n\tpTzQ5YtlzUyI0Brbf/tDWjdQORV4EPVud4R87ssorMGh3tRu/gP9LZ5EVMse7yK/bN\n\t9PYv2oENIlcfg==","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=sl4XrqTTJc5gEp6+LkWwrGxgpSO7vlqBTyt8N43qGBo=;\n\tb=C76yQ9qYhK5QpFk7ZozCkSCF20CsfcLmYeud0b8jo8+CyZBpE6UsXKE15kdq8xopXa\n\tQmuMNappCn3HmIGXTxZcqpoLWJdGm2p9+sNFtuHJx2tdfSVXJdWQAt64EMHlcVTT+nCA\n\t/zPH39eEQJnUKcIkunsN5wuvA6GARn/NjlEKZ+qWPM64VlcNaVgDSDO9u2TPDyPaN5pC\n\tdOUMMiEOXPFTe4P1YvIgMdCzacI9hY/cSY2Tpn30u+VNKbWTPrcLX/BuGgMy52nwDeMJ\n\tkTkS7c+SFcX04DHxwz2aJM7sEVzO3YAXOFlgo6XX6LDHgBTDOWYye7cyxFR+2i5Laf2D\n\tvi9w=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"C76yQ9qY\"; 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=sl4XrqTTJc5gEp6+LkWwrGxgpSO7vlqBTyt8N43qGBo=;\n\tb=6z5YHcIsby+09e1NBs6v3XyZcX7S7EbFaw5OEqSWzWafVLU6ZbL+mfkmq3KA/0eI8A\n\tWtChUI4YxswEZX5YimZ2e11TAFUB1uEhR8wjdBQOG7mpLgWsNK2qsjMkVZFxBZADGVA6\n\tylc2B7ClU/82lIZzUqzDl627oCPpljYGrecthp0FlOBVtBK1n5ziVROeoax+axHIHz46\n\tez5rekdouXTU2Eu9eLe8ZSLhKbEbsZDYJtHioCllHvsd5SYJl2FY85w/TMpgqJzDaHIG\n\tgHg1ZMEDSJGlaes7z0SHq4boeZAkowgNpCe5lAS/udCmnDTHzq8jpUZdPueI8xcK+FEe\n\tJc7A==","X-Gm-Message-State":"AJIora+350Z4RToBeOILZ5CiGdkKKr4+t7PRTid3TVkL3v9CdacT/WrZ\n\tanjTBRcBD7t2VYrlgKBMsajuMVz4/fuSNNIa3/ju0g==","X-Google-Smtp-Source":"AGRyM1tUamsRwpoJhtYp2C9Z7EVPqq2y+agt7x45eywRx3wAO1O+6Z3Fv8RMTfQOi3PvqK6dXbpXJpAdwxzPIXlVwoU=","X-Received":"by 2002:a17:906:9bd1:b0:72a:5b6f:a3c8 with SMTP id\n\tde17-20020a1709069bd100b0072a5b6fa3c8mr29585622ejc.21.1657028756941;\n\tTue, 05 Jul 2022 06:45:56 -0700 (PDT)","MIME-Version":"1.0","References":"<20220705134100.26713-1-naush@raspberrypi.com>","In-Reply-To":"<20220705134100.26713-1-naush@raspberrypi.com>","Date":"Tue, 5 Jul 2022 14:45:46 +0100","Message-ID":"<CAHW6GYKRiPehkQ72n4Bsu-OaCh3PqMz1FfZ93ix=g3UZCiZT1w@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1] pipeline: raspberrypi: Fix\n\tincorrect advertising of ScalerCrop","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>"}}]