From patchwork Fri Mar 24 14:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18444 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 2AEFDC0F2A for ; Fri, 24 Mar 2023 14:29:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 542A9626D7; Fri, 24 Mar 2023 15:29:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679668167; bh=5zj1ZK6RZTdGDyrBsCSug+3xNfV1FsZrVJVaDPc75go=; 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=qXUQIjWG5AsZxEt51JntFVPWOZ3Ga9Ib07PdCiGnt0wvmytpixUDkeecnyS3hI+4g byq3tW1z/K77etrmiZknYjKjCZoTr/ouzdfOAHKul8mlYcJjiL8xEdY9MPXBen0kHf xv+UBY7I4poBptpF/k2QBdbFuWD1p3Cg6tXGHIk9esW1yYlT2SPwLTcPrDbkEelnk1 1HQf1hyl9WXOxhFVYTjCmmJM0+IQngF3OafPTUrQGl0sCpSsVOxTLeFBmNNf45dvO8 fInZJIN8sYOieCoV4IEHakJqazcRIqfVFszMFNbFTPxPnznkgA74iyFql5E0OJTkKf Uzi97ix9eJxug== Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5051626D7 for ; Fri, 24 Mar 2023 15:29:25 +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="csCrVjvl"; dkim-atps=neutral Received: by mail-lf1-x134.google.com with SMTP id g17so2474176lfv.4 for ; Fri, 24 Mar 2023 07:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1679668165; 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=+b1RxHmY2A94x2fOL2v5UZLA9FzXYBcNr7XlKQGwweA=; b=csCrVjvllNOFCyb+IzRdQVc1UVmGSgxsaVQC/IIbwfcxPMpg19EqHspw7fiC1NH2sE qOPOjBl1YWeEoaRCNeMWLew4yaEkkD04s3kxHQEFfLLfD6Wpn4pdVae52o++mz9fOeYN l8f5POfjbp07KENin/LsqmJYJ4x9C+A5tfBUBJc9tVQgWpd0nmEo5g4WvR9sZpsKwXlY 6OLjsHA4DTgHRCA0VTCy1TlK2CxqAfQ1jhqIci3qLlkLnugmd4Ixdd9mx9Dec3frnvdN aZTR4Cxp99j7V7Mf7mwhmxaGY6bfqeyWpKOFWafVkH7+7hb15lH6Hj/KM1DuBQaXJ01I J4WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679668165; 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=+b1RxHmY2A94x2fOL2v5UZLA9FzXYBcNr7XlKQGwweA=; b=twoNn957yRjm2pqnyYxa3OkqKC1DI62akojdvfEi7+OTRirR8HBcWnT+np5zOa5Sep hq8tDPRISscCdv67eYeSLqOcakUDnhoYgqbyoACdVTs4ohBcPCzEsFWOachtgh06NY1E kItNmRulRYx73vw/fW9mM5U/keT/yglBEuekByYq0abkw8NJktNt1CnaINO0J6WzOJ/e Lg0t0dSsxj4Cb+cRzEYPw5I+Ua5lydLMH6MSQbNjP60L8fRQmlYNid+W/ytEWjCCGGj3 9I1/8/bPF1s7KeGtJQpYcKkr4eYCMWrqJtQAlY2IxtZadz1eg5l6KLGkM/7qWE9DtmTi XnCQ== X-Gm-Message-State: AAQBX9dcm61/5/js1VLGQlfZztvxrLoDT4qJ/7UBmRaTSQ8wSXaVuA1J RPO0PH9likWfOid1t1PJAc6fo7aVQky0JGfeltE= X-Google-Smtp-Source: AKy350ZO8VM12pPssOnBFcoQdCANLXO9TsZ8MLjMmnTuCFPyr2YBxW3tvKHQi2we5xxM8CI46miTyg== X-Received: by 2002:ac2:515b:0:b0:4e8:3b51:e7eb with SMTP id q27-20020ac2515b000000b004e83b51e7ebmr785866lfd.7.1679668164766; Fri, 24 Mar 2023 07:29:24 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id j21-20020a2e8515000000b002a10b2ea089sm981714lji.16.2023.03.24.07.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 07:29:24 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 24 Mar 2023 15:28:59 +0100 Message-Id: <20230324142908.64224-2-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230324142908.64224-1-dse@thaumatec.com> References: <20230324142908.64224-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- 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 << ")";