From patchwork Tue Mar 14 14:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18392 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 2E9B9BD80A for ; Tue, 14 Mar 2023 14:49:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C88116270E; Tue, 14 Mar 2023 15:49:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678805393; bh=Z6VTu0zidCzMXOnvglkDj64XlU2ckQvY+pnZGFLWnOY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BpM9ZCZvt4lPQ7uLLRd3Tcf/B3jj4fRwsOCfaKTB/K9p67KVZt2RvxWnA84Tr94P0 sNoHmMDv/lU6iRhPeqMoWQwFhtNO9ungwO4oxBffN3edirhEivWgz+e4EQnQE8Trnv 6NrlSHEpjSLr3qBd68m3JLbXnYNGH8FsDuk1+yE9XukA2HTWOZ1VZAGA7o4VHkzioO a+PT4C+8UZYAwjDHFiNJH0cHLzZTI+UAHLQ2ZdPaA3bPP57HvqOBNP/neb0lKFMRQS dOPRMMxWotmwtii1Kb0UMwazXxh12JwAB/aD6+cbFngyalas34jbP0E79nRZbd3YfK sAGmm0YLoaYaQ== Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 008AD626D6 for ; Tue, 14 Mar 2023 15:49:52 +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="AORGVMt2"; dkim-atps=neutral Received: by mail-lj1-x22c.google.com with SMTP id b10so16320920ljr.0 for ; Tue, 14 Mar 2023 07:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1678805391; 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=r4NPnLMb4QG0NlqecrFPvrV8a7pjMAgwk3MN6og/a88=; b=AORGVMt24yxthdUL94YX1Ea9tf93Zh/t877JSlo6gT448qMnFi9etsTBgZkDxH0NML x3COgG5/jzTgh1fi2V7aZkXuwmFNU+A6u3fSJYi1NmW0RTm5rkldohsyHWhpt2rzSb1n JsYVR7nZalx6ElbcnzbMVwwcPRwwJ9R5+FceIKHc6jgfspL72zesRZCIxuQ2mCwMoeww pPhruF5FkMOMPQvx34uObHfaV9Q4wezVSXNdA+pxHAebxmhG1Qe80O/B3G8uWEYKDKJX Gl6WViLc1DZuvu3eDEUG1KVo1oHoUNwiEWiRAOcugg1hyCIjrcvo9UtMIvZCULZBR1/m Vg4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678805391; 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=r4NPnLMb4QG0NlqecrFPvrV8a7pjMAgwk3MN6og/a88=; b=abw9B66wwHvLawIWhP+NgjOL7/w02JcGGR54j8naWcUldsCOLP3DmCuCUun1RL70qo 2HWQc/O1vX8w15LcFisTM/OGnMwxPFzImoSwAk68km5ttGiQFoa19rJj8pe+kQ5dAeDW LvhEFiEC0yHTCFuSHP/MHcojkKIvng0joq3N2R/yPyhTkRCKxCKwgLEylCTkXR0hap8d n+ROPZkGh08DNA//ZeHxYzrxC7AZTOifiH5bueCeNhInJVncX9jye91kXk2vyEMRWhqe Nh8c+EQDZXiWC2Y4pxlfdx0ZEa8PuWh3C/LYk9I+OndC+xnlazGO3MIzcw6jjgst1qhC aCxQ== X-Gm-Message-State: AO0yUKXFgKOiyeLGgj9clYFjt76ESl3qCb8/CPOXGL42yw3r9/VL+py0 zxvDgyqRQyPZt5XOkgtTx+jAAJmLq8dOCbhX8To= X-Google-Smtp-Source: AK7set9ntMGZ8yPlHpEaoZ896SEK5Cvgd7Nu7pzI6GMTfg7HGlDMNaOGBxoXkKibxplYHAGyaC8IQQ== X-Received: by 2002:a2e:97d1:0:b0:298:9fbf:61dd with SMTP id m17-20020a2e97d1000000b002989fbf61ddmr825963ljj.16.1678805391269; Tue, 14 Mar 2023 07:49:51 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id q25-20020a2eb4b9000000b00295a35f30e1sm470961ljm.115.2023.03.14.07.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 07:49:51 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 14 Mar 2023 15:48:25 +0100 Message-Id: <20230314144834.85193-2-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314144834.85193-1-dse@thaumatec.com> References: <20230314144834.85193-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 01/10] 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 Cc: jacopo.mondi@ideasonboard.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Check in pipeline handler if camera lens exists, and expose its controls to the IPA. Signed-off-by: Daniel Semkowicz Reviewed-by: Jacopo Mondi --- I did not include the "reviewed-by" markers from last review as there was a change in this commit. Code in IPA file has been moved a bit down to better fit with the changes from the next commit. 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..248cf5e0 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_; @@ -265,6 +267,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; }); + if (!ipaConfig.lensControls.empty()) + lensControls_ = ipaConfig.lensControls; + for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get()); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 8a30fe06..83fb6287 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" @@ -812,6 +813,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 << ")";