From patchwork Wed May 22 14:54:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20085 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 82E60BD87C for ; Wed, 22 May 2024 14:55:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3C7E663490; Wed, 22 May 2024 16:55:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S9IdCRbs"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BD8B463498 for ; Wed, 22 May 2024 16:55:03 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:9beb:c30d:4413:8c99]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0950EABE; Wed, 22 May 2024 16:54:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716389691; bh=3T7KcnyzGHIwDuHiBmpx9YpR357ZPuNdJ+BWyCNw9hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S9IdCRbsDDpl4xdvGlu3AWxF7Iu8Jd3FMLsdzF9tK81+zpIoXc0B07crUOYrrUJGL y5yEsJLKhAoQrp8GhRN2cuIignKQ4B2g1koKgEkp4tV9PtofxAuZ3SLLDkEq/Zu8gC 8lp3YUTotm4U7ezbomy1zBzh3ehadpRC9Pfk9QQU= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v2 3/4] ipa: rkisp1: Fix algorithm controls vanish after configure Date: Wed, 22 May 2024 16:54:37 +0200 Message-Id: <20240522145438.436688-4-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240522145438.436688-1-stefan.klug@ideasonboard.com> References: <20240522145438.436688-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::map::merge(source) has the side effect of actually moving items from source to target. In this case the controls where removed from the source maps on the first call to updateControls() and on the second call to updateControls() they where 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 --- 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); }