From patchwork Thu Jan 19 08:41:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18140 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 183BCC3240 for ; Thu, 19 Jan 2023 08:42:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C268E625E3; Thu, 19 Jan 2023 09:42:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674117729; bh=wiJDd7y1fycJxQBDca5N59hZkPVi42l9UKQoTsqJ2Hg=; 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=fHU/KwxI1OmStEXXi6XaSZEx7y7sA4HmHwGB3NolQR+mAfYEKwnUhQGMZ5sOct01p qKSQ4HEwkDkXpqZQTXOOvbOqH4zThjYUId5sIUvQfnc/HIAvX5DEoD5Ht2A5AQvP7I dxHwXHruhmn4Vvrz1ZEDtER0kQy6mwZ+Ho8P7kbhI3VTNnLdM8Rt/DZmtNjUnRfS+q bB95UZ8RANWuwVKn22MSzLB4d5GkwkWXwLxZBw3hbEs7QuQ861NNXuwh9PyUPyv+6K I77rwm0Szpo50LA0SvATXeH5dxjdPPnvXami9OIfAB/MIjNMlXjSkUWarL1wv/RD9C n4rVXW5/5b9tw== Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0667F61EFC for ; Thu, 19 Jan 2023 09:42:08 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=thaumatec-com.20210112.gappssmtp.com header.i=@thaumatec-com.20210112.gappssmtp.com header.b="katmaffj"; dkim-atps=neutral Received: by mail-wm1-x333.google.com with SMTP id fl11-20020a05600c0b8b00b003daf72fc844so3065354wmb.0 for ; Thu, 19 Jan 2023 00:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e7gmClNwwbQ5j37r/NYsnEON5vAdMEldk/3IHa6ctl4=; b=katmaffj+oTS0pfQf7rYfNgFP7mcc7Dkla3H1fa1KZ87Bs4vpQInfQnh5gupLh2eWJ TPCmiYWmHtcSww4WpQ7d1Ip19W7ykwbR/4QsESpxuvTCcoLBmE872HiFgU0QvRILdzdk tdHJKCn0xQdVauntuwyciFcs15dZj30qOP5W0YFKV/+h+otAjcW7EsLYIKIKht/aFa3J 4JVkFIY2N0rpQ5gbkrVV0dDBpa2nR7KP+nMVObvB+eSq3XULCMD/D6x2tZO0CU3Xp4Ff 5mtTLoZJEN8NN61IqKcu65aABLvXIvl8cCF+2TK4kc1fV5Yw/VBUaJHYCKu5SW3+AaC7 teuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e7gmClNwwbQ5j37r/NYsnEON5vAdMEldk/3IHa6ctl4=; b=kw1AJb1OfPmsDA4Ba5m4SAS/s1iVB7LAEUzluyH0Fi8vADnJ/COHki6TBOicmTkftr F0mr+0x9GEPmXxFjeW2ZZDbe2E48q2ehSQcaJb/NRPPsz3q3PMMtyhPPV15Jlm62nhDG 8lIo5WuVcV67j4PUyoUHqCo3vA5ZM33hgpi80bIozZaouDWhdQQqVVRyRBmbedrM/llO 65Fw92+wLgV23aZmljXE/lFBNhhqp4ad1Yh7eDTmgF8sP2K98GNyEDAVFF2ZaVqwsDNo irUvocR+arP6dPzMTcZdklKVE0XAJBNl22cj8y7872WOGJ7Re55EYa2Vs4Y6bMdHVKEr GNfQ== X-Gm-Message-State: AFqh2kqDlWW0+4JuL1CMBDho7np8TxrNCqvsqkDmCp3pfgiJA2aOyEk6 x98aYggM6EKcqYe0F/YiRaHST3o1iqGVE7riTzs= X-Google-Smtp-Source: AMrXdXtgfMtfQ1RJ0yYQTVE/8MTFole2zvm8W393kIIDzo0+x/plubGdX1XncLDMlcPZ4gyOtvemIg== X-Received: by 2002:a05:600c:601c:b0:3d3:4f56:62e1 with SMTP id az28-20020a05600c601c00b003d34f5662e1mr9390438wmb.27.1674117727760; Thu, 19 Jan 2023 00:42:07 -0800 (PST) Received: from localhost.localdomain (ip092042140082.rev.nessus.at. [92.42.140.82]) by smtp.gmail.com with ESMTPSA id j10-20020a05600c074a00b003db0ee277b2sm3935754wmn.5.2023.01.19.00.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 00:42:07 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Jan 2023 09:41:05 +0100 Message-Id: <20230119084112.20564-2-dse@thaumatec.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119084112.20564-1-dse@thaumatec.com> References: <20230119084112.20564-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/8] rkisp1: Add camera lens to PH and expose it to 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: , X-Patchwork-Original-From: Daniel Semkowicz via libcamera-devel From: Daniel Semkowicz Reply-To: Daniel Semkowicz Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Check in pipeline handler if camera lens exists, add expose its controls to the IPA. Signed-off-by: Daniel Semkowicz Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- include/libcamera/ipa/rkisp1.mojom | 1 + src/ipa/rkisp1/rkisp1.cpp | 5 +++++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 1009e970..bf6e9141 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 { diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 6544c925..9e861fc0 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -80,6 +81,7 @@ private: std::map mappedBuffers_; ControlInfoMap sensorControls_; + std::optional lensControls_; /* revision-specific data */ rkisp1_cif_isp_version hwRevision_; @@ -215,6 +217,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, { sensorControls_ = ipaConfig.sensorControls; + if (!ipaConfig.lensControls.empty()) + lensControls_ = ipaConfig.lensControls; + const auto itExp = sensorControls_.find(V4L2_CID_EXPOSURE); int32_t minExposure = itExp->second.min().get(); int32_t maxExposure = itExp->second.max().get(); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 5bdb4d25..0559d261 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -31,6 +31,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" @@ -807,6 +808,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 << ")";