From patchwork Tue Oct 11 10:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17584 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 321EFC0DA4 for ; Tue, 11 Oct 2022 10:59:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D9E9B62D87; Tue, 11 Oct 2022 12:59:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665485965; bh=a0wSkQwqJRJh/McpXgjcVKoZ5Ge2YAV2j16pAVOYYIk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZfFPevY7HjzCXkll6N7zygS5ZEJnValBLmGxqo+JBiUDt12umPiPyFufvYUAMwRqh 2QSljwZHZ6FY1O8wTbxWcOsuSmP1MSLfjXomBfr63EkjvHYWlcElBlsX+kMXWzKyOI CjhUtnKXRdbFHUnDemTuhngbf0ATU6ieAOEi2EHO/A92K8g9e4hrDFBK1jZYQQbB8z yXlF5C3qXurUoRBIrYvVX2BMv6mTvyGU6vKkjdJsHGFxcUnC06b846X4ZWcJtgyCnj Tvf+MAMpEWdrM84UyDCguoEqS/o/xnmbBhQjUGNw8w2QBHA4P6MCYspiptWj+qKdtY tQlsOBl2lfEZQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E54C862D76 for ; Tue, 11 Oct 2022 12:59:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="udnrh5Bp"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4C80EAFC; Tue, 11 Oct 2022 12:59:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665485964; bh=a0wSkQwqJRJh/McpXgjcVKoZ5Ge2YAV2j16pAVOYYIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udnrh5Bpjc/6iFWsJ4SUwQeQ/u6mU3H33Kj6XUUrfvLcUZRaIoOePimmvHpwHugv4 m2VV3EbGqGOWpyIVSvWtyqg4lv4ZpF2GDo01mA362xbxQk4gK0T3OnJZnPTK/fgWuF K6L4CqJ/Df036cxhdGK65DvIPPiCQrxn9AAJBpZQ= To: libcamera-devel@lists.libcamera.org Date: Tue, 11 Oct 2022 19:58:56 +0900 Message-Id: <20221011105859.457567-7-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221011105859.457567-1-paul.elder@ideasonboard.com> References: <20221011105859.457567-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 6/9] ipa: vimc: Add IPAOperationCode to init() parameter list 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" For the purpose of testing serializing/deserializing enums in function parameters, add IPAOperationCode to the parameter list of init(). Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- No change in v5 Changes in v4: - remove [TEST] from commit subject Changes in v3: - pass enum by value as opposed to by const reference No changes in v2 --- include/libcamera/ipa/vimc.mojom | 2 +- src/ipa/vimc/vimc.cpp | 6 ++++-- src/libcamera/pipeline/vimc/vimc.cpp | 2 +- test/ipa/ipa_interface_test.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/libcamera/ipa/vimc.mojom b/include/libcamera/ipa/vimc.mojom index 718b9674..16149787 100644 --- a/include/libcamera/ipa/vimc.mojom +++ b/include/libcamera/ipa/vimc.mojom @@ -18,7 +18,7 @@ enum IPAOperationCode { }; interface IPAVimcInterface { - init(libcamera.IPASettings settings) => (int32 ret); + init(libcamera.IPASettings settings, IPAOperationCode code) => (int32 ret); configure(libcamera.IPACameraSensorInfo sensorInfo, map streamConfig, diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index 85afb279..5d494b63 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -31,7 +31,7 @@ public: IPAVimc(); ~IPAVimc(); - int init(const IPASettings &settings) override; + int init(const IPASettings &settings, const ipa::vimc::IPAOperationCode code) override; int start() override; void stop() override; @@ -66,7 +66,7 @@ IPAVimc::~IPAVimc() ::close(fd_); } -int IPAVimc::init(const IPASettings &settings) +int IPAVimc::init(const IPASettings &settings, const ipa::vimc::IPAOperationCode code) { trace(ipa::vimc::IPAOperationInit); @@ -74,6 +74,8 @@ int IPAVimc::init(const IPASettings &settings) << "initializing vimc IPA with configuration file " << settings.configurationFile; + LOG(IPAVimc, Debug) << "Got opcode " << code; + File conf(settings.configurationFile); if (!conf.open(File::OpenModeFlag::ReadOnly)) { LOG(IPAVimc, Error) << "Failed to open configuration file"; diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index d2f2e460..df749bf7 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -471,7 +471,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) data->ipa_->paramsBufferReady.connect(data.get(), &VimcCameraData::paramsBufferReady); std::string conf = data->ipa_->configurationFile("vimc.conf"); - data->ipa_->init(IPASettings{ conf, data->sensor_->model() }); + data->ipa_->init(IPASettings{ conf, data->sensor_->model() }, ipa::vimc::IPAOperationInit); /* Create and register the camera. */ std::set streams{ &data->stream_ }; diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 6b93e976..cd20348a 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -106,7 +106,7 @@ protected: /* Test initialization of IPA module. */ std::string conf = ipa_->configurationFile("vimc.conf"); - int ret = ipa_->init(IPASettings{ conf, "vimc" }); + int ret = ipa_->init(IPASettings{ conf, "vimc" }, ipa::vimc::IPAOperationInit); if (ret < 0) { cerr << "IPA interface init() failed" << endl; return TestFail;