[{"id":29797,"web_url":"https://patchwork.libcamera.org/comment/29797/","msgid":"<ZmbVHhbmrXWtab3y@pyrite.rasen.tech>","date":"2024-06-10T10:27:42","subject":"Re: [PATCH v4 2/3] ipa: rkisp1: Fix algorithm controls vanish after\n\tconfigure","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Wed, Jun 05, 2024 at 11:53:50AM +0200, Stefan Klug wrote:\n> std::unordered_map::merge(source) has the side effect of actually moving items\n> from source to target. In this case the controls were removed from the source\n> maps on the first call to updateControls() and on the second call to\n> updateControls() they were missing in the source maps and therefore also\n> removed from the camera. Fix this by using insert() instead of merge(). This is\n> most likely cheaper than copy-contructing the source map.\n> \n> Fixes: 4c5152843a2a (\"ipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminance\")\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/rkisp1/rkisp1.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 6687c91e7fb0..17474408ed2d 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -427,7 +427,7 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,\n>  \t\t\t\t\t\t\t      frameDurations[1],\n>  \t\t\t\t\t\t\t      frameDurations[2]);\n>  \n> -\tctrlMap.merge(context_.ctrlMap);\n> +\tctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end());\n>  \t*ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);\n>  }\n>  \n> -- \n> 2.43.0\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 485D5BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 Jun 2024 10:27:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0E8F65463;\n\tMon, 10 Jun 2024 12:27:50 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E0DB65457\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Jun 2024 12:27:49 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B440A512;\n\tMon, 10 Jun 2024 12:27:36 +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=\"ffNqQEAL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718015257;\n\tbh=iQg7ng8rGwP4Mu4gqz/6hy1VeCBhR4Mmyu2O+8akyL8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ffNqQEAL1icnfiZ500DZYCXwPn5Sa2WX4shW0vRd3G7olw6AUFPVVZG6r8AtkpNx3\n\tXpbykjRaMtYzgjjvK6BTu00ZUrDB3oeh17kCsFWkkpmaP5cSM9MVptgtPF4W2Oc8Po\n\tMAXNKzMh9EJd8oLW6ZmAucGnarY7VKf8yDaUtVZk=","Date":"Mon, 10 Jun 2024 19:27:42 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 2/3] ipa: rkisp1: Fix algorithm controls vanish after\n\tconfigure","Message-ID":"<ZmbVHhbmrXWtab3y@pyrite.rasen.tech>","References":"<20240605095417.157703-1-stefan.klug@ideasonboard.com>\n\t<20240605095417.157703-3-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240605095417.157703-3-stefan.klug@ideasonboard.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>"}}]