From patchwork Wed Jul 28 16:11:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13139 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 0495BC322E for ; Wed, 28 Jul 2021 16:10:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6F6DE687C3; Wed, 28 Jul 2021 18:10:32 +0200 (CEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E0EC360506 for ; Wed, 28 Jul 2021 18:10:31 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 67A8960009; Wed, 28 Jul 2021 16:10:31 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Jul 2021 18:11:11 +0200 Message-Id: <20210728161116.64489-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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" Hello, this v2 re-proses "libcamera: Initialize controls in the IPA" with a few patches before that aims to support lookup by ControlId * in de-serialized ControlInfoMap. 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. I get a weird warning from Doxygen 1.9.2 src/libcamera/ipa_controls.cpp:138: warning: Documentation for undefined enum 'IdMapType' found. include/libcamera/ipa/ipa_controls.h:18: warning: Member IdMapType (enumeration) of file ipa_controls.h is not documented. Although the field is documented. Maybe a doxygen bug ? I checked and scoped enums seems to be documented as regular enums with \enum... 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 Thanks j Jacopo Mondi (5): libcamera: controls: Create ControlInfoMap with ControlIdMap libcamera: controls: Use ControlIdMap in deserialization test: control serialization: Test lookup by ControlId 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 | 9 +- 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 | 76 +++++++++++-- src/libcamera/controls.cpp | 82 +++----------- src/libcamera/ipa_controls.cpp | 31 ++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 103 ++++++++---------- 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 | 22 ++++ .../ipa_data_serializer_test.cpp | 4 +- 20 files changed, 307 insertions(+), 180 deletions(-) --- 2.32.0