From patchwork Thu Feb 2 11:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18230 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 2B9CCC3243 for ; Thu, 2 Feb 2023 11:13:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EEEC6625E8; Thu, 2 Feb 2023 12:13:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336385; bh=BKrr5i+kBXbxctCnsZH5tPxNGb0HnL9JYU/Q/uFnfUQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xcSknLY5yEQGtU9Ji6kkR9GKEX1NN3Ct7pkhcwnuV4YcC/nUD2c94R68BhjZUezii UU/E0OlncnfPzMRh54Jy0Ffv9inEEM0e0jUDmw5XoIm1s/xzA3TbX9MJyefvRpL3Ws Qrv9UvSq6NZe6IzCdcNbzlmgnNI0HxMfaaamP7JV06BfGt/4J83HZc4JF0jf0lw9Ou DwlmXOpD1EkYeREEZqht1gETrnqzH8mxVT6tTFQuzll+wqJ6IlC7sNEUAVhDeYQROD OvgQDn2rsGU35swIB0WQR1O2lpg0VbLf0xyBR957ASlsv13ykKNuCKy/ROzKCNM4vU lUlLR2RKArIYg== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 153B1625D8 for ; Thu, 2 Feb 2023 12:13:03 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="Pu+oXIIu"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2emuifAjWvAGK6KVtV+1tAxEATiHMQL1KQuyfEROFFQ=; b=Pu+oXIIu72SJE0JlO3U9meAtcS mwxrEEiUfjQON+A8Bh9ABNBpE1bi1REx3Iim7l6Jkptb/BfqgxSn6j6oowRVlYZaR3Lo2epQDemi1 AQdfoLLr2NdYn5z7ZaWudd6DKwtt2dDFzy4fRFsqmiSFwIMBT/3UKSUdRbluriqFH6RU=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWY-008Uhs-1n; Thu, 02 Feb 2023 12:13:02 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:46 +0100 Message-Id: <20230202111252.3366729-2-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, as mentioned on the mailing list some time ago, I was wondering how to use more complex optics together with libcamera IPAs. Currently, only optics with a VCM focus lens are considered in libcamera. With these, an absolute position is set and the lens is almost immediately at the new desired position. Pretty simple. For a s [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 1/7] ipa: rkisp1: add basic camera lens support 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Adding basic support for lenses, as has been done similarly in other pipeline handlers. Parts of it will be changed later in the series, but the intended changes are more recognizable. Signed-off-by: Matthias Fend --- include/libcamera/ipa/rkisp1.mojom | 4 +++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 1009e970..d33e93df 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -11,6 +11,7 @@ import "include/libcamera/ipa/core.mojom"; struct IPAConfigInfo { libcamera.IPACameraSensorInfo sensorInfo; libcamera.ControlInfoMap sensorControls; + libcamera.ControlInfoMap lensControls; }; interface IPARkISP1Interface { @@ -37,6 +38,7 @@ interface IPARkISP1Interface { interface IPARkISP1EventInterface { paramsBufferReady(uint32 frame); - setSensorControls(uint32 frame, libcamera.ControlList sensorControls); + setSensorControls(uint32 frame, libcamera.ControlList sensorControls, + libcamera.ControlList lensControls); metadataReady(uint32 frame, libcamera.ControlList metadata); }; diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 5f22a29d..d4fbcf4b 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -32,6 +32,7 @@ #include #include "libcamera/internal/camera.h" +#include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/delayed_controls.h" #include "libcamera/internal/device_enumerator.h" @@ -112,7 +113,8 @@ public: private: void paramFilled(unsigned int frame); void setSensorControls(unsigned int frame, - const ControlList &sensorControls); + const ControlList &sensorControls, + const ControlList &lensControls); void metadataReady(unsigned int frame, const ControlList &metadata); }; @@ -395,9 +397,20 @@ void RkISP1CameraData::paramFilled(unsigned int frame) } void RkISP1CameraData::setSensorControls([[maybe_unused]] unsigned int frame, - const ControlList &sensorControls) + const ControlList &sensorControls, + const ControlList &lensControls) { delayedCtrls_->push(sensorControls); + + CameraLens *lens = sensor_->focusLens(); + if (!lens) + return; + + if (lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE)) { + const ControlValue &focusValue = lensControls.get(V4L2_CID_FOCUS_ABSOLUTE); + + lens->setFocusPosition(focusValue.get()); + } } void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata) @@ -810,6 +823,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) ipaConfig.sensorControls = data->sensor_->controls(); + CameraLens *lens = data->sensor_->focusLens(); + if (lens) + ipaConfig.lensControls = lens->controls(); + ret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_); if (ret) { LOG(RkISP1, Error) << "failed configuring IPA (" << ret << ")"; From patchwork Thu Feb 2 11:12:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18231 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 34557C323E for ; Thu, 2 Feb 2023 11:13:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 73106625DD; Thu, 2 Feb 2023 12:13:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336386; bh=x9zKuY85f+MSA/WV8hlaY6W4lcG/2BIOCArLQIxJBqA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=rmYrIFwAKrTUNwbGcH/n1B5UM+zYUmacXHASKZ4AapP6bAerjMudcDQVA4hZxGkiJ ZvxcRwmhdELT5KVzaGV8khHOnQ14Du+p8YAL8XuSv1Du6cIAMClm0qhMnZcQHiMD05 tunW7vBJTjBiQCKU2mFPjFktsl81nWsg7GJXnI3f9U0GLSsIumShqvwKfROTwd52iT CW0pov4SHwdI9LvtAnOPwHhTnDIkX0rVtMJFSnbUyM2OxSz5TB3pP9T3LYfDdeNrnS S5zEF7t1EJntul74PRm978p780UymiMjGsXBb/u0OKmSTH2Szg174RDT5KAdrNCNQo R1Ly+9fhtH3Nw== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 67AA3625DD for ; Thu, 2 Feb 2023 12:13:03 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="YpLa0fK2"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SdbSshu4kv/MXr1ASzNqa+xRbnLNFNWqqO+mPH27ygA=; b=YpLa0fK28f4aAiBFJ+NoVSQq2b sC9RmCd+itBNxgb17EwWhx/OagKxU3sNFxESU3yCR+sd6pGrwHE1BHEZJaNYum2Yic64F1cknlcNa +qAxpxE+ODhOtubI7VA3E8KbollOq2YU8V5Vt8OmJe4fQGFbQs2k1TdL+9+cdKH49vVo=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWY-008Uhs-L6; Thu, 02 Feb 2023 12:13:02 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:47 +0100 Message-Id: <20230202111252.3366729-3-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Adding basic support for lenses, as has been done similarly in other pipeline handlers. Parts of it will be changed later in the series, but the intended changes are more recognizable. Signed-off-by: Matthias Fend --- include/libcamera/ipa/rkisp1.mojom | 4 +++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 21 +++++++++++++++++++-- 2 files changed, 22 insertion [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 2/7] libcamera: camera_lens: add method to set controls on subdev 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This method allows v4l2 controls to be set directly on the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h index 277417da..66c32a46 100644 --- a/include/libcamera/internal/camera_lens.h +++ b/include/libcamera/internal/camera_lens.h @@ -27,6 +27,7 @@ public: int init(); int setFocusPosition(int32_t position); + int setSubdevControls(const ControlList &controls); const std::string &model() const { return model_; } diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp index b3d48199..c8fadda5 100644 --- a/src/libcamera/camera_lens.cpp +++ b/src/libcamera/camera_lens.cpp @@ -95,6 +95,16 @@ int CameraLens::setFocusPosition(int32_t position) return 0; } +int CameraLens::setSubdevControls(const ControlList &controls) +{ + ControlList lensCtrls(controls); + + if (subdev_->setControls(&lensCtrls)) + return -EINVAL; + + return 0; +} + int CameraLens::validateLensDriver() { int ret = 0; From patchwork Thu Feb 2 11:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18232 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 B44ECC329C for ; Thu, 2 Feb 2023 11:13:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D1F86603BF; Thu, 2 Feb 2023 12:13:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336386; bh=WVDPlWY1vqRIsqop3ZaZPhFJ7lDNiETEj+WaEiZVmao=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BI30YlIr26eHOdStd7weY0qrivp+A5OzywfK08qYae+OZLIoW9R1ocN3qr7WBnEoA 30VoEuBYB1J2LM7d2kKbabBJF3C2imMwNmLBrvVDLXfterwqgoGD5trH0lRCimJT4R UIOmLDvaoibwo8GMJsSdoSzrnu+wFqEvXW3JCouGLxHvpk2fC0G6yQAWRB7PnOR9qn LzYEOonDioDnnxdDix+mXPyipILVsK2K8rP+SPJKTrP396m3wvAStMmM+/2u0fy64d 6vBNS6hnET0AxHaoe0P4WrX1KomNG7j3LsnlsqUkL9i1bi+O8iTnnSsLQIGh2CHCIP d8TSJivOdlDow== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D043B625DD for ; Thu, 2 Feb 2023 12:13:03 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="hQZpeIPw"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2oKGyofZPFVFSyRgoLKCL6PmzvWBKUB94KWl8cArkF8=; b=hQZpeIPwSVBswh6kPyP5cPwwnI xslHJunuuHPrRlu2hGfjlHvQ45HAFF7CKZhsE5BdWUlB+jvqieeMUBy36mGGT1Yq9rjRvOPLcXdht w2R1Aktvz8f3V30JX2QYrjo+aMxukI9Xh1iM/UMC5HI+yWrrwKbW4/+ASJmRmYUdesWg=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWZ-008Uhs-2g; Thu, 02 Feb 2023 12:13:03 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:48 +0100 Message-Id: <20230202111252.3366729-4-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This method allows v4l2 controls to be set directly on the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 3/7] pipeline: rkisp1: transparently pass lens controls from the IPA to the lens 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of parsing the values in the v4l2 controls from the IPA and passing them to CameraLens (where they are then converted back to v4l2 controls), the IPA v4l2 controls are reused directly. Signed-off-by: Matthias Fend --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index d4fbcf4b..e4f328cb 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -403,14 +403,8 @@ void RkISP1CameraData::setSensorControls([[maybe_unused]] unsigned int frame, delayedCtrls_->push(sensorControls); CameraLens *lens = sensor_->focusLens(); - if (!lens) - return; - - if (lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE)) { - const ControlValue &focusValue = lensControls.get(V4L2_CID_FOCUS_ABSOLUTE); - - lens->setFocusPosition(focusValue.get()); - } + if (lens) + lens->setSubdevControls(lensControls); } void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata) From patchwork Thu Feb 2 11:12:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18233 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 115E1C329D for ; Thu, 2 Feb 2023 11:13:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5A86D625FD; Thu, 2 Feb 2023 12:13:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336387; bh=IJM0sPJVoVgRDUhm/ng2uOPTtuuVzILf0Eq8yO5L6BA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QcB4OFBtVbpvm3WF0KzeaACIN0UihACaamcdxXe7JdXS0EaKQWj3FYDiQ0/L5jZc2 o4HDVK2hJKLzkyVhbowY1Zr1SDasgJwsRiW5/DWl/qKNi/GDsnDugg34NmHdX8vLob 8RKrgFlWl4FcK9LSnrBAF8JktgsfVKr7G7d3WPuEdBCbKtH9dUL3fVaFmihVA3Npb0 tTwOTqhxJuFpcXJRgCkTBU0v2hF7nqq00+DcKFEBi4pjIdBHsqh+71qC/g4BooYkdN cPL2SQhqn+4jtj9rivnIjEf1aNcKM/KAVu3HV8iaFIWjF9fmjdhfhKrvub3au6qfxc pMIZAz9bP0ZLw== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 36E48625DD for ; Thu, 2 Feb 2023 12:13:04 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="fGPglgdG"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PSlPvh+Xr3XYBmy9nxyVSa0N9gvuSRvG7V6V0q92yGI=; b=fGPglgdGHfvN2OBf1MVUJ+YQtQ mZXSD6mc+2R3LocjVJMEa8hXiFE4RVLp2OmZ0RJJILFZ//fKvu2RGmqlaIw2eC9d3Ub64FLZ6NSHA qTMbTfWxymVneNsNKc6x7NBpWK8IFiLY/yyhBHTtoHsbBFAOI0KB9BSraF7PaMBFier4=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWZ-008Uhs-FL; Thu, 02 Feb 2023 12:13:03 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:49 +0100 Message-Id: <20230202111252.3366729-5-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Instead of parsing the values in the v4l2 controls from the IPA and passing them to CameraLens (where they are then converted back to v4l2 controls), the IPA v4l2 controls are reused directly. Signed-off-by: Matthias Fend --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 4/7] libcamera: camera_lens: add method to get controls from subdev 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This method allows v4l2 controls to be read directly from the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h index 66c32a46..f5212ea7 100644 --- a/include/libcamera/internal/camera_lens.h +++ b/include/libcamera/internal/camera_lens.h @@ -33,6 +33,7 @@ public: const ControlInfoMap &controls() const; + ControlList getControls(const std::vector &ids); protected: std::string logPrefix() const override; diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp index c8fadda5..ddcda232 100644 --- a/src/libcamera/camera_lens.cpp +++ b/src/libcamera/camera_lens.cpp @@ -160,4 +160,9 @@ const ControlInfoMap &CameraLens::controls() const return subdev_->controls(); } +ControlList CameraLens::getControls(const std::vector &ids) +{ + return subdev_->getControls(ids); +} + } /* namespace libcamera */ From patchwork Thu Feb 2 11:12:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18234 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 5AC61C329E for ; Thu, 2 Feb 2023 11:13:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 064FF625EB; Thu, 2 Feb 2023 12:13:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336388; bh=tgUipenE8oUlCb1no8iYRMFLZZ7FJuEt91oSiSk9bu4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GSBitwgor1Yv/FbZ6XkX1B7BM8MiW/scfq+8axqbbT7DJoADJ8+2dXNQIWo6TLH+p oGPY1fjjgnxmL5MRRdvjGsY09daFp+gVBfreFvCY2j9CuvnqC6PpW+X9eXdyE2oJ3P 7hc8ZHLKokoF9n6jGwtVDxIh4z6umjzJQ4efZ8idPOGXDKigurZpf7p1ghvna5I+YE YgOATLk3ZzWjxpUpMbwyyBca36iVnPPcFfmouYzhjCZdY8CJp23gL59wFWx8zBs4+1 1vznLRSrvoOY2I+iucYcbRZGvHPg7OMHQjyI45wAwnADGgDhg5ux45XzU+gTXhxjUc DuuzRel6KogqA== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8FB68625EC for ; Thu, 2 Feb 2023 12:13:04 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="X7QnafDy"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3xGQBeIlosTo1QuMaY675z/EeLWzWhTkVO4YNhiF80M=; b=X7QnafDy366Si4KVXBdfwv7zds HzbqF7qxEaIyf9KjsyJJgxq/ivGY9GjVDTzl6em2XvGg3qWD3JfI1bh3zBUHZJzQHSMowMIWDMxDm kH3N2P2QRmhB8WtXQaxlqu2J7Bony40NDgVmEm3wgLIXD5AoE8HRVxBkRyDe9pDsRtPI=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWZ-008Uhs-Rb; Thu, 02 Feb 2023 12:13:04 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:50 +0100 Message-Id: <20230202111252.3366729-6-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This method allows v4l2 controls to be read directly from the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 5 +++++ 2 files changed, 6 insertions(+) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 5/7] libcamera: v4l2_device: add function to get a list of volatile control ids 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This method returns all IDs of the v4l2 controls that are marked as volatile. Signed-off-by: Matthias Fend --- include/libcamera/internal/v4l2_device.h | 1 + src/libcamera/v4l2_device.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 50d4adbc..1c1de64a 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -36,6 +36,7 @@ public: const ControlInfoMap &controls() const { return controls_; } + std::vector getVolatileControlIds(); ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 57a88d96..6605d36c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -147,6 +147,21 @@ void V4L2Device::close() fd_.reset(); } +std::vector V4L2Device::getVolatileControlIds() +{ + std::vector ids; + + for (auto &[controlId, controlInfo] : controls_) { + uint32_t id = controlId->id(); + const struct v4l2_query_ext_ctrl &info = controlInfo_[id]; + + if (info.flags & V4L2_CTRL_FLAG_VOLATILE) + ids.push_back(id); + } + + return ids; +} + /** * \fn V4L2Device::isOpen() * \brief Check if the V4L2 device node is open From patchwork Thu Feb 2 11:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18235 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 9DF2BC3243 for ; Thu, 2 Feb 2023 11:13:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6C814625F5; Thu, 2 Feb 2023 12:13:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336388; bh=2JBSV49yKX59+cPdZzFvdRmSrJWohVS0Wl9A6Ae5tQs=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tTS+299O7j+IAhBLhaxeI4LMJ9vhGAel0KzrG6j1QfYeaxscOr3LXiDstDrtZ9m2u JH+JvRE2wG+xaoRjIydPfeIlP8G53bi0eGu0Zy7gyzUTs3vHcAju5HzcrQG+BMm7kE dKzX85A73ChndVJM8V2x0g2V/glDiUdSuHWYcqYDHjtfo3awDpkqpvyPCFx9MKu/Md Zt/HBtv2ClSsqMKOzIyFPCYPe5A11v0zGyj5umNGLj0W7Ep84j3ObPOYU8xA6IO8Ut whbvY/xIP60o46+bD5xq9QAPRPtWGVNV6zq/AhYuGin0T17G8W1FUSrhHVcPhjsf8o pSTKbNHhpEY9A== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 047C1625EF for ; Thu, 2 Feb 2023 12:13:05 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="QuX+QgmI"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ccHxFoTNzmRXiyfGvw5+0vDwFwjfxWSe2v8SFRjnGLQ=; b=QuX+QgmI7MMXjaQ7WSHqSG/IRJ qt4Yqg6PvcyqHVIOloQfQG+0LJfJA1MAhXydfmGX1QxZ1pM4OEytIm910UbqYHb4CfiYZnabnQOLM T1SFGJJPjdvCC8BjVOd7iyEutOM4boDlDmm+U44IDiehHdc0+Ctrim/rConEnqHZa84g=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWa-008Uhs-8S; Thu, 02 Feb 2023 12:13:04 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:51 +0100 Message-Id: <20230202111252.3366729-7-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This method returns all IDs of the v4l2 controls that are marked as volatile. Signed-off-by: Matthias Fend --- include/libcamera/internal/v4l2_device.h | 1 + src/libcamera/v4l2_device.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 6/7] libcamera: camera_lens: add method to get a list of volatile controls 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This method reads all v4l2 controls marked as volatile from the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h index f5212ea7..9aa0b84a 100644 --- a/include/libcamera/internal/camera_lens.h +++ b/include/libcamera/internal/camera_lens.h @@ -34,6 +34,7 @@ public: const ControlInfoMap &controls() const; ControlList getControls(const std::vector &ids); + ControlList getVolatileControls(); protected: std::string logPrefix() const override; diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp index ddcda232..5bace1e7 100644 --- a/src/libcamera/camera_lens.cpp +++ b/src/libcamera/camera_lens.cpp @@ -165,4 +165,13 @@ ControlList CameraLens::getControls(const std::vector &ids) return subdev_->getControls(ids); } +ControlList CameraLens::getVolatileControls() +{ + std::vector ids; + + ids = subdev_->getVolatileControlIds(); + + return subdev_->getControls(ids); +} + } /* namespace libcamera */ From patchwork Thu Feb 2 11:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18236 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 D426DC329F for ; Thu, 2 Feb 2023 11:13:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03FBA62600; Thu, 2 Feb 2023 12:13:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336389; bh=BVKpqVC9xGR6xzI0O91hmWTtwDzCtMT6oCu/Y2MVGbg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pqRxk6UlZfTvfe6pY3vpOG0wpZu1Ll5pNzoOrkLTLX+TK/iZNjMbOJoufSGoTZ/fF dGwKh/AdfB8S65Ghh1E4VD6fzY/aSx4NAU1bzZI8crhKy8Qj5563tfYhS76BYkX7qZ TcfvG0u9NsRpxrk50B+uEhDq3S5peaF6wosC1zhMK2+Z60kl518ZUoHbCvSahss6rJ FtIorn2zD7HxbgCXfdNQ1/b92t2osyW9SVqWTjV0vuPjwCj+uZ3Qhxtk7DIBQkE1Q9 lo8g6SWXLtEQ8bSduJwaRDDZ1q7W+8mvmD/F+5xjE91EsQBLpkE8/D2ciDwho72VJl FVDj2UOt2jM5w== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A6482603BF for ; Thu, 2 Feb 2023 12:13:05 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="nWK1meAj"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9GZ+zWhGJaBVEBa+rOxQbXfMFUX89kReqVqYSHT0yE8=; b=nWK1meAj+WK8o8I7PZnoGlJ+rp qBBNlfqwqdS0NvIg8l2mvK9MgooH9hy1ulqVRi5+CvalPUNjqU7x0e6dHR8lprcLb22BW715zAQfc CWpz5v4tGbFnVvNUrfpqKeY7w1Fth2GTqYqoWx/uWdMS8oeFIFo3JPcEkR2VGqISCjGQ=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWa-008Uhs-Li; Thu, 02 Feb 2023 12:13:05 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:52 +0100 Message-Id: <20230202111252.3366729-8-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This method reads all v4l2 controls marked as volatile from the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 7/7] ipa: rkisp1: pass volatile lens controls to 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: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" All v4l2 controls that may change by themselves (volatile) are passed to the IPA. An example for this can be the current actual position of the focus lens, which is needed for an autofocus algorithm. Signed-off-by: Matthias Fend --- include/libcamera/ipa/rkisp1.mojom | 3 ++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index d33e93df..9ede5fde 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -33,7 +33,8 @@ interface IPARkISP1Interface { [async] queueRequest(uint32 frame, libcamera.ControlList reqControls); [async] fillParamsBuffer(uint32 frame, uint32 bufferId); [async] processStatsBuffer(uint32 frame, uint32 bufferId, - libcamera.ControlList sensorControls); + libcamera.ControlList sensorControls, + libcamera.ControlList lensControls); }; interface IPARkISP1EventInterface { diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index e4f328cb..6073e5fa 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -1275,9 +1275,10 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer) metadata.timestamp); if (isRaw_) { + const ControlList lensCtrls; const ControlList &ctrls = data->delayedCtrls_->get(metadata.sequence); - data->ipa_->processStatsBuffer(info->frame, 0, ctrls); + data->ipa_->processStatsBuffer(info->frame, 0, ctrls, lensCtrls); } } else { if (isRaw_) @@ -1319,8 +1320,15 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer) if (data->frame_ <= buffer->metadata().sequence) data->frame_ = buffer->metadata().sequence + 1; + ControlInfoMap emptyInfoMap; + ControlList lensControls = ControlList(emptyInfoMap); + CameraLens *lens = data->sensor_->focusLens(); + if (lens) + lensControls.merge(lens->getVolatileControls()); + data->ipa_->processStatsBuffer(info->frame, info->statBuffer->cookie(), - data->delayedCtrls_->get(buffer->metadata().sequence)); + data->delayedCtrls_->get(buffer->metadata().sequence), + lensControls); } REGISTER_PIPELINE_HANDLER(PipelineHandlerRkISP1)