From patchwork Mon Jun 3 14:06:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20194 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 BAB1BBD87C for ; Mon, 3 Jun 2024 14:08:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 735A3634C5; Mon, 3 Jun 2024 16:08:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SfZq6OIR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DE8A1634B2 for ; Mon, 3 Jun 2024 16:08:47 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:6067:153a:95aa:2e07]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DE132BC0; Mon, 3 Jun 2024 16:08:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1717423721; bh=wkiqljmx4xrVI90ZK9ikSSauOUITOi0m37Q9z699oVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SfZq6OIRNdSqPKy5lheJGFhbTG9te9oJqkouJt5rqAlHGFEf2htxJVTQp/rEd190x YhQ2BvRCYq3ZvmegXQEcqr7H7as9uvRkjmlE1NVHHAJY3S/IlkXl49A/r52z8Wn7VC dQ9qjaIf1/0LjZO44kKlr0gQWXQtNeTfiowqzyNQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v3 2/3] ipa: rkisp1: Fix algorithm controls vanish after configure Date: Mon, 3 Jun 2024 16:06:29 +0200 Message-ID: <20240603140806.90045-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240603140806.90045-1-stefan.klug@ideasonboard.com> References: <20240603140806.90045-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. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham --- v2 -> v3: - fixed typos in commit message. 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 6687c91e..17474408 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); }