From patchwork Tue Aug 10 15:12:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13284 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 9887EBD87D for ; Tue, 10 Aug 2021 15:11:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0042D6884E; Tue, 10 Aug 2021 17:11:27 +0200 (CEST) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C38F687F0 for ; Tue, 10 Aug 2021 17:11:26 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id CED44200004; Tue, 10 Aug 2021 15:11:25 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 10 Aug 2021 17:12:06 +0200 Message-Id: <20210810151211.56702-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/5] libcamera: Initialize controls in the IPA 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" During the review of v1 it has been pointed out by Umang that: # LIBCAMERA_IPA_FORCE_ISOLATION=1 cam -c1 --list-controls [0:10:59.880617099] [11495] ERROR IPU3 ipu3.cpp:1201 Exposure control not initializaed by the IPA Camera 1 not found The issue boils down to the fact the control deserialization procedure re-creates ControlId to populate the deserialized ControlIdMap. As we have globally available ControlIdMap, the ControlId * should be taken from there when possible, in order to allow lookup by id. With the new patches: # LIBCAMERA_IPA_FORCE_ISOLATION=1 cam -c1 --list-controls Using camera \_SB_.PCI0.I2C2.CAM0 as cam0 Control: ScalerCrop: [(0x0)/1344x736..(0x0)/4224x3136] Control: PipelineDepth: [2..3] Control: TestPatternMode: [0..2] Control: FrameDurationLimits: [31425..320388] Control: ExposureTime: [41..33306] Next, when addressing the update of ControlInfoMap due to a camera configuration the de-serializer caching mechanism will probably play a role. But that's for later. Thanks j v4->v4: - Minor style and grammar fixes - [1/5]: Expand ControlInfoMap::validate() and ASSERT in the caller - Tested with CTS v2->v3: - Fix spelling in commit messages as suggested by Paul and collect tags - [1/5]: - ControlInfoMap::validate() - Rework ControlInfoMap documentation as suggested by Laurent - [2/5]: - Moved test earlier and simplified code - [3/5] - Drop 'enum class' and use Laurent's suggested naming - Simplify de-serializer code that uses a localIdMap as suggested by Laurent - [4/5] - Change IPAIPU3::init() prototype init(libcamera.IPASettings settings, libcamera.IPACameraSensorInfo sensorInfo, libcamera.ControlInfoMap sensorControls) - Move exposureTime_ initialization in PH back to initControls() v1->v2: - [1/5]. [2/5], [3/5]: new patches - [4/5] - Do not remove IPASettings but include it it IPAInitInfo - Rework a todo item as suggested by Laurent - Remove an non necessay initialization - [5/5] - Collect tags Jacopo Mondi (5): libcamera: controls: Create ControlInfoMap with ControlIdMap test: control serialization: Test lookup by ControlId libcamera: controls: Use ControlIdMap in deserialization libcamera: ipu3: Initialize controls in the IPA ipa: ipu3: Tidy-up includes include/libcamera/controls.h | 13 +- .../libcamera/internal/control_serializer.h | 1 + include/libcamera/internal/v4l2_device.h | 1 + include/libcamera/ipa/ipa_controls.h | 9 +- include/libcamera/ipa/ipu3.mojom | 5 +- include/libcamera/ipa/raspberrypi.h | 40 +++--- src/ipa/ipu3/ipu3.cpp | 78 ++++++++++- src/ipa/ipu3/ipu3_agc.cpp | 2 +- src/ipa/ipu3/ipu3_agc.h | 3 - src/ipa/ipu3/ipu3_awb.cpp | 3 +- src/libcamera/control_serializer.cpp | 66 ++++++++-- src/libcamera/controls.cpp | 121 ++++++++---------- src/libcamera/ipa_controls.cpp | 29 +++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 98 +++++++------- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 3 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +- src/libcamera/pipeline/vimc/vimc.cpp | 2 +- src/libcamera/v4l2_device.cpp | 3 +- test/serialization/control_serialization.cpp | 9 ++ .../ipa_data_serializer_test.cpp | 14 +- 20 files changed, 320 insertions(+), 182 deletions(-) --- 2.32.0