From patchwork Thu Jan 19 10:45:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18149 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 E8F5BBD87C for ; Thu, 19 Jan 2023 10:45:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 25EC6625ED; Thu, 19 Jan 2023 11:45:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674125156; bh=JkcTM5Umb+cECJQuUWQyERqriHYrMgewZU5j8qC3h/I=; 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=Thwj1rtIONQW3kGAjbhYkGFK3Co6ekwNWvWGi2ahkInZaxqUmvXEm55v49eDXqHQH TO+haVKqg4cAoTIUxpvXbAAV6Unh1Jwky/8IOllFPb5NTPoJwsRye6T3waYmj1bile Yy9zLH94KEqW1upejpNI20ZpmEU6IjnqocEkl3nq1RBqEv9DhD6VmBfHds6hF4WwyG gXfdVTU2yeVReRZQlvBTvdt6VfYxHZYGUUSEcRmV+QzmlOTzXFFxtUXFrulcZ7wR4p UZplNshLGiXJIy57H0qTEsJsEypXVsTKQccZynPQOm3FJe5Lfz3HMbS8yZt1Hh4W9b 7Rl0iwa2afK9g== 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 0895061EFC for ; Thu, 19 Jan 2023 11:45:53 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="GD0pMMEe"; dkim-atps=neutral Received: by mail-wm1-x333.google.com with SMTP id e19-20020a05600c439300b003db1cac0c1fso1770438wmn.5 for ; Thu, 19 Jan 2023 02:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; 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=9jfLANeusc6CqNEiWhjZhKjeKnRVCnEagrhwvI6M960=; b=GD0pMMEeJ/KREVZCVs7p2IJJqeMld/HDbgtXCTNRaE09Md/L1D3LYTUXDDzjoY4F37 5qLSc+YfRBzKlhDkQNSxLIGyN/mFdwkPxfj2Z39Gdi6fbGu/Mkiavjbnv9sRPLrWn2n1 Ev0fJbd0P6pjjpu2X9wHnnH9mhFyOBijuge93fh1lyQ8uALOV+UKLAjsWLsprOrRNHD0 6sOiYGtB1MYH3L2sRGIgaoist/HEA4Tcw2X/6ADRPd2Vg52yqfY0I75M6EsTw0hVR/6D tlgxIIEmNLmbGDqoiyfm0LvUpk4c0whHjIHakU0o+w2uIr9l5ABK4CvOnjY4c4MrGx2B ifoA== 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=9jfLANeusc6CqNEiWhjZhKjeKnRVCnEagrhwvI6M960=; b=7UC+w+YYkwTR8KPmmLotrJXXZbsM5ewOOfjWwVV3FbP+qWhngJ9JEHZa2uX+ATvmOg QaiKbuHEb9MwRQvLSMBRkQrSPiUpCIO+lmwWwoo8TEDhg8AIrA3MB6XbN70ZQeB2uxFc Zq/s7TnZve4pyAUjVRu+0ebp/gaug+BvHhFerFYQqE79k3Il4f6p5W63A1HTe9vWonB2 D1N/QO/u7E2bvDMciJ9TE0K9F0M5UeoLWVQbXfcrPuk5B0MJaO8CH56YSYs7djsOpGca IMY7FmdWjULatHgPJWSQKwllmHERZhiB8StacBhdNGqoeAQnklGjFtesX90ZGpUi0Pyf Sh2Q== X-Gm-Message-State: AFqh2koA4dTJEB+FsUKZhzAcxw1x7+JgnL6YDOc2v+qsrDKiC17OucvP 3sKhlFBymeWFplu3ymkByLr8WNFHtF+n4bPy8K8= X-Google-Smtp-Source: AMrXdXslQp4dPRhsgNrrb0go/CzD0Zcv6RdFPv2W5H3C4Nc4yfN46Ynt12zmSIE/O6ZamQCaOqifDw== X-Received: by 2002:a05:600c:1609:b0:3db:12a:5e65 with SMTP id m9-20020a05600c160900b003db012a5e65mr9735632wmn.4.1674125152419; Thu, 19 Jan 2023 02:45:52 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id be12-20020a05600c1e8c00b003db06224953sm5332029wmb.41.2023.01.19.02.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 02:45:51 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Jan 2023 10:45:31 +0000 Message-Id: <20230119104544.9456-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230119104544.9456-1-naush@raspberrypi.com> References: <20230119104544.9456-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 01/14] pipeline: ipa: raspberrypi: Check if lens actuator is available 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Cc: Nick Hollinghurst Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Check if a lens actuator is available by the presense of the lens driver entity in the pipeline handler. Pass this result to the IPA on init. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Nick Hollinghurst --- include/libcamera/ipa/raspberrypi.mojom | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 7 +++++-- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 189f978a5081..e7dabcbe5313 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -50,7 +50,7 @@ struct StartConfig { }; interface IPARPiInterface { - init(libcamera.IPASettings settings) + init(libcamera.IPASettings settings, bool lensPresent) => (int32 ret, IPAInitResult result); start(libcamera.ControlList controls) => (StartConfig startConfig); stop(); diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index bead436def3c..ec18497155ba 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -115,7 +115,7 @@ public: munmap(lsTable_, MaxLsGridSize); } - int init(const IPASettings &settings, IPAInitResult *result) override; + int init(const IPASettings &settings, bool lensPresent, IPAInitResult *result) override; void start(const ControlList &controls, StartConfig *startConfig) override; void stop() override {} @@ -158,6 +158,7 @@ private: ControlInfoMap sensorCtrls_; ControlInfoMap ispCtrls_; + bool lensPresent_; ControlList libcameraMetadata_; /* Camera sensor params. */ @@ -204,7 +205,7 @@ private: uint32_t maxSensorGainCode_; }; -int IPARPi::init(const IPASettings &settings, IPAInitResult *result) +int IPARPi::init(const IPASettings &settings, bool lensPresent, IPAInitResult *result) { /* * Load the "helper" for this sensor. This tells us all the device specific stuff @@ -241,6 +242,8 @@ int IPARPi::init(const IPASettings &settings, IPAInitResult *result) return ret; } + lensPresent_ = lensPresent; + controller_.initialise(); /* Return the controls handled by the IPA */ diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index f6303e60e1e6..62417669bdc5 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -32,6 +32,7 @@ #include "libcamera/internal/bayer_format.h" #include "libcamera/internal/camera.h" +#include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/device_enumerator.h" #include "libcamera/internal/framebuffer.h" @@ -1606,7 +1607,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result) IPASettings settings(configurationFile, sensor_->model()); - return ipa_->init(settings, result); + return ipa_->init(settings, !!sensor_->focusLens(), result); } int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPAConfigResult *result)