From patchwork Fri Aug 6 10:14:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13243 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 268CDC3238 for ; Fri, 6 Aug 2021 10:14:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F39A68822; Fri, 6 Aug 2021 12:14:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HkDWSZFV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9A41660266 for ; Fri, 6 Aug 2021 12:14:29 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.40]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 374554FB; Fri, 6 Aug 2021 12:14:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1628244869; bh=LOlEihKVREYgw4BspzaqXfUVGW13itfafNyQhNRqtq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HkDWSZFVenok9mWRkMkh/pgyqneUXjh19C5wzuJaExZe1MqUkvOf1k3keMa7hCWla jWr7ClCSZb/lAHHm0FzJzg8Ir/htKkwmAFV4sR4pGs0YMBwd2THVPyV6fcnfH/9VXB gYpnHRf/SRtA6TWUPsiqL8P7+97sDYc9h8Yy545Y= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Aug 2021 15:44:06 +0530 Message-Id: <20210806101409.324645-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806101409.324645-1-umang.jain@ideasonboard.com> References: <20210806101409.324645-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/4] ipa: vimc: Add configure() function 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Laurent Pinchart As part of an effort to make the vimc IPA usable for testing, extend it with a configure function. The configuration is currently ignored by the IPA. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Umang Jain Signed-off-by: Umang Jain --- include/libcamera/ipa/vimc.mojom | 5 +++++ src/ipa/vimc/vimc.cpp | 13 +++++++++++++ src/libcamera/pipeline/vimc/vimc.cpp | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/include/libcamera/ipa/vimc.mojom b/include/libcamera/ipa/vimc.mojom index 86bc318a..ee66353d 100644 --- a/include/libcamera/ipa/vimc.mojom +++ b/include/libcamera/ipa/vimc.mojom @@ -19,6 +19,11 @@ enum IPAOperationCode { interface IPAVimcInterface { init(libcamera.IPASettings settings) => (int32 ret); + + configure(libcamera.IPACameraSensorInfo sensorInfo, + map streamConfig, + map entityControls) => (int32 ret); + start() => (int32 ret); stop(); }; diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index 0c0ee006..fb134084 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -34,6 +34,10 @@ public: int start() override; void stop() override; + int configure(const IPACameraSensorInfo &sensorInfo, + const std::map &streamConfig, + const std::map &entityControls) override; + private: void initTrace(); void trace(enum ipa::vimc::IPAOperationCode operation); @@ -86,6 +90,15 @@ void IPAVimc::stop() LOG(IPAVimc, Debug) << "stop vimc IPA!"; } +int IPAVimc::configure([[maybe_unused]] const IPACameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map &streamConfig, + [[maybe_unused]] const std::map &entityControls) +{ + LOG(IPAVimc, Debug) << "configure()"; + + return 0; +} + void IPAVimc::initTrace() { struct stat fifoStat; diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 12f7517f..b7dd6595 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -295,6 +295,22 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config) cfg.setStream(&data->stream_); + if (data->ipa_) { + /* Inform IPA of stream configuration and sensor controls. */ + std::map streamConfig; + streamConfig.emplace(std::piecewise_construct, + std::forward_as_tuple(0), + std::forward_as_tuple(cfg.pixelFormat, cfg.size)); + + std::map entityControls; + entityControls.emplace(0, data->sensor_->controls()); + + IPACameraSensorInfo sensorInfo; + data->sensor_->sensorInfo(&sensorInfo); + + data->ipa_->configure(sensorInfo, streamConfig, entityControls); + } + return 0; }