From patchwork Wed Jun 5 09:53:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20207 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2190EC32C8 for ; Wed, 5 Jun 2024 09:54:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9FAB365443; Wed, 5 Jun 2024 11:54:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="n7zab9GK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D7366543A for ; Wed, 5 Jun 2024 11:54:29 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:dcc4:f2dc:93ce:ff8f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A615214B0; Wed, 5 Jun 2024 11:54:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1717581260; bh=6y6ZrqxFyeo04yqZlQiP45swXL8m+qZ7N1myOnzNink=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n7zab9GKrPOEotV4fHHzWKcWll2Y41bGP77u5i/h6SCWO2G/GOqN//+KP+9kPMGSC vf9JTpbhTJsNTYYryrerk1LjcGCeIySTTqy3uFo6mlK3hXMIeWi2VMheosTnYggVFM SitHpMwFyBLULLSjSUJkJWxAoVNZCgdG/cmEdaeM= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v4 2/3] ipa: rkisp1: Fix algorithm controls vanish after configure Date: Wed, 5 Jun 2024 11:53:50 +0200 Message-ID: <20240605095417.157703-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605095417.157703-1-stefan.klug@ideasonboard.com> References: <20240605095417.157703-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" std::unordered_map::merge(source) has the side effect of actually moving items from source to target. In this case the controls were removed from the source maps on the first call to updateControls() and on the second call to updateControls() they were missing in the source maps and therefore also removed from the camera. Fix this by using insert() instead of merge(). This is most likely cheaper than copy-contructing the source map. Fixes: 4c5152843a2a ("ipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminance") Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/rkisp1/rkisp1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 6687c91e7fb0..17474408ed2d 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -427,7 +427,7 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo, frameDurations[1], frameDurations[2]); - ctrlMap.merge(context_.ctrlMap); + ctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end()); *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls); }