From patchwork Mon Jan 23 15:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18176 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 B8F32BEFBE for ; Mon, 23 Jan 2023 15:49:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6F652603C7; Mon, 23 Jan 2023 16:49:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674488991; 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=L8VuOSrI5Ih57X0bAJV3Weznt4nbmBqPBmZ/uGr660XYkJ005ANI777AY/X+OWtEb xrBm3ME57vdwEQVVYP/1p9s2wkJqMGBB0P9qEPQJBUPSREWBuwTkrnG52RKUsHstVL 7AyJbfkOBj6eotRFFHChJ8av7PdvHEEqAZrT6gKf29Dz9ZTpCdcAu65JFJzBk7RJYb b04qLSSvTSF4vGQeJwn3Cn6pdfjsrCRPWbArOylmEz97+CGniQWxxRA5CaGC58pNie Bdfn+ZnIAktkS7IwVeUpRttbBreM3NLz0w35PIR1dOIyTayeOnIyqodnkhp7oH6o4J /GJ/a7txrO7Dw== Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48302625D8 for ; Mon, 23 Jan 2023 16:49:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="oSaM+z8Z"; dkim-atps=neutral Received: by mail-wm1-x336.google.com with SMTP id g10so9380372wmo.1 for ; Mon, 23 Jan 2023 07:49:48 -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=oSaM+z8ZkzVVptpliruh2wd4kUh+TLeVmzdaJXS9pUlNMQ+OYnM+MgkIcASnQVrTls HvqIX2Zdw6lm4f7Cdg7b202lKqjtFQ/D1sbcazrA0TDpJxT54OGsnXOxgTXX1yhLKN0j 6L+BqXINmYaJlT5ueahuQOUWOgKH7jwdUnYeoffSXOjmJhLVePiN9M2tE7CbzOQlCASu toCMknfrqAY12I2nC1D/eJDw0OTb5i1DcNMxk33K48GrdM5i38yeljoo3cNODs99ZdLR ZE/l0Gqw/dpkRTfx6KXTEDPsH7mgQep0Zu9EucvTIkQ2MNZ3lZTG25IVakGxTyee6pdW tV3Q== 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=EYSiPEXFely5ovDEK/uosjs0tKiu11AKskO0bKyEMpIVkeizuIDpM1tKkkL8jFw/Ke rk4rDr8mZh6AYHJlXYFv8g3j+ZufNr/xJh6SqCyIsA8fRyY/Dypb2Idn3SFWDJiVd2/m +4B415btoco0YXsWZZyyuBS4NdnVCNpWa74c8l6PwQ6OWg5ybWERrqWaiBxR3GjP18kQ izwr+azzdUAN1DgWjbghKp4nHAQ7nvQeb4quE3GgDoD8zHrMwmgjnzZ3pl8TDcZGVTvh WHzt0g3wQ/f1ZyIA37l7yxUZ2VjMS8zJuDOMZIE5x5LJkTh00Gb0msD6fOGh7vR6faTs Ah/g== X-Gm-Message-State: AFqh2kpaUu5GH68ua7ivNAm2zZAaR2vjNaS6a+fMlbGo4pVrO+mS4bZG IBaF/pJvZlMlNb4+TSdDNoNLr/KSv/jwjt8Q94Q= X-Google-Smtp-Source: AMrXdXvBd0YHbNL+sccg056MS9UJFJTC3CTEUc3Fg6AOSYY66DXVaFKNwnDYrA61yWqBOdPdu5EjMg== X-Received: by 2002:a05:600c:16d3:b0:3d3:513c:240b with SMTP id l19-20020a05600c16d300b003d3513c240bmr24098326wmn.7.1674488987743; Mon, 23 Jan 2023 07:49:47 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c181000b003d1de805de5sm10339689wmp.16.2023.01.23.07.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:49:47 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Jan 2023 15:49:21 +0000 Message-Id: <20230123154934.27803-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123154934.27803-1-naush@raspberrypi.com> References: <20230123154934.27803-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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)