From patchwork Wed Mar 17 10:02:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11606 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 94A6ABD80C for ; Wed, 17 Mar 2021 10:02:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 514F668D66; Wed, 17 Mar 2021 11:02:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IWb8hKTm"; dkim-atps=neutral Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 610C968D61 for ; Wed, 17 Mar 2021 11:02:24 +0100 (CET) Received: by mail-ej1-x635.google.com with SMTP id si25so1614408ejb.1 for ; Wed, 17 Mar 2021 03:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pWK9zy4d291lt9BeUusdrPtxdNtadrrurtsmDLh0kJQ=; b=IWb8hKTmtHtTwiulc6mf+ms9t4Yws8vFWHsAS9Vqow25MbMw6ECBMKfLE3VBXvIiaJ evO9R5F0T+L8w8JDyKIUT+OjEVJpZcBYzvTIIvBq97QgfKLTdTcOTwedTnqygjiP6GTU fiN79jfTe8MbVY95iNwcXbxlPRQKwYN6Il4ns9x6Zwrd7w3pjjFe83Y+nZlJnX/hhSN/ n6eKfNVy9SgLccbYJgwX7GaRsGwenVhTzfh4Gk6GEB63RlZOQ+Sr1QueKsT6Mae63Oj1 4a7R4ZKCZtPuDl2DQB9Y8dosxDWAdIIQrSDjTuaEV1ifotiKAXDkOKduluCUxiVuRi4r /4hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pWK9zy4d291lt9BeUusdrPtxdNtadrrurtsmDLh0kJQ=; b=EQGQrnlAzxKBsCzCXKLszuvFmLERvR5RchU9bMzSJqkX6j0FMA/Nhh1J26XfyRV8Ee 0jtySelWByRqclnTSAFJUhq5lSve8qkBviLRRyoU+bvpgBlXjHa7Cn+3LYWWAdO7GsjD q37VDWPrm4w583KaekOdo5474iOyrDEyE9uqWn6vZY1KM6JCTjQuy+wJOv5OFIAWpn+v rwSSJkH5MyipY7KV9zPFt6QCS0YmXMmMiRisbXN2Q3tH+Hn9FESfNNMqYM4w8LLmUCvU Kgh4aJfF1ADw8m8gncpGrHsBgHaIq/ELLjPrvK2Wn4syBVal1tPsT2aqB1fwWifEdQq0 j5rw== X-Gm-Message-State: AOAM533jkhUwHZ2GtQ+sU1Cp4nhoN6CdjmP7Mk9rPt10/Yn2dqYp4cn+ 73uIjlfgAk2WllDfWrRwtrEkjRJkPObQig== X-Google-Smtp-Source: ABdhPJwCB5NMcVUq66bzy8edhm65qrGXxi/iV9V3SEKnRj1r3jtbYLBTjKa01ZYJ3Zm7ovaUjO/h8w== X-Received: by 2002:a17:906:3b47:: with SMTP id h7mr33982401ejf.377.1615975343782; Wed, 17 Mar 2021 03:02:23 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id p24sm12061179edt.5.2021.03.17.03.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 03:02:23 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Mar 2021 10:02:11 +0000 Message-Id: <20210317100211.1067585-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210317100211.1067585-1-naush@raspberrypi.com> References: <20210317100211.1067585-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/7] ipa: raspberrypi: Rationalise parameters to ipa::configure() 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" Rename ConfigInput to IPAConfig to be more consistent with the naming, and remove ConfigInput::op, as it is never used. Replace ConfigOutput with a ControlList type, as that is the only return type from ipa::configure(). Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/raspberrypi.mojom | 16 +++++----------- src/ipa/raspberrypi/raspberrypi.cpp | 13 ++++++------- .../pipeline/raspberrypi/raspberrypi.cpp | 13 +++++-------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 7549397a27c4..f38c22611cc4 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -29,17 +29,11 @@ struct ISPConfig { ControlList controls; }; -struct ConfigInput { - uint32 op; +struct IPAConfig { uint32 transform; FileDescriptor lsTableHandle; }; -struct ConfigOutput { - uint32 params; - ControlList controls; -}; - struct StartConfig { ControlList controls; int32 dropFrameCount; @@ -57,7 +51,7 @@ interface IPARPiInterface { * \param[in] streamConfig Configuration of all active streams * \param[in] entityControls Controls provided by the pipeline entities * \param[in] ipaConfig Pipeline-handler-specific configuration data - * \param[out] results Pipeline-handler-specific configuration result + * \param[out] controls Controls to apply by the pipeline entity * * This method shall be called when the camera is configured to inform * the IPA of the camera's streams and the sensor settings. @@ -65,14 +59,14 @@ interface IPARPiInterface { * The \a sensorInfo conveys information about the camera sensor settings that * the pipeline handler has selected for the configuration. * - * The \a ipaConfig and \a results parameters carry data passed by the + * The \a ipaConfig and \a controls parameters carry data passed by the * pipeline handler to the IPA and back. */ configure(CameraSensorInfo sensorInfo, map streamConfig, map entityControls, - ConfigInput ipaConfig) - => (int32 ret, ConfigOutput results); + IPAConfig ipaConfig) + => (int32 ret, ControlList controls); /** * \fn mapBuffers() diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 417a7922c3bd..1c928b72fbd0 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -85,8 +85,8 @@ public: int configure(const CameraSensorInfo &sensorInfo, const std::map &streamConfig, const std::map &entityControls, - const ipa::RPi::ConfigInput &data, - ipa::RPi::ConfigOutput *response) override; + const ipa::RPi::IPAConfig &data, + ControlList *controls) override; void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; void signalStatReady(const uint32_t bufferId) override; @@ -313,16 +313,14 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo) int IPARPi::configure(const CameraSensorInfo &sensorInfo, [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls, - const ipa::RPi::ConfigInput &ipaConfig, - ipa::RPi::ConfigOutput *result) + const ipa::RPi::IPAConfig &ipaConfig, + ControlList *controls) { if (entityControls.size() != 2) { LOG(IPARPI, Error) << "No ISP or sensor controls found."; return -1; } - result->params = 0; - sensorCtrls_ = entityControls.at(0); ispCtrls_ = entityControls.at(1); @@ -379,7 +377,8 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo, agcStatus.analogue_gain = DefaultAnalogueGain; applyAGC(&agcStatus, ctrls); - result->controls = std::move(ctrls); + ASSERT(controls); + *controls = std::move(ctrls); } return 0; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 16568d56f31c..1f8307a3c1c5 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1240,7 +1240,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) std::map streamConfig; std::map entityControls; - ipa::RPi::ConfigInput ipaConfig; + ipa::RPi::IPAConfig ipaConfig; /* Get the device format to pass to the IPA. */ V4L2DeviceFormat sensorFormat; @@ -1283,19 +1283,16 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) } /* Ready the IPA - it must know about the sensor resolution. */ - ipa::RPi::ConfigOutput result; - + ControlList controls; ret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig, - &result); + &controls); if (ret < 0) { LOG(RPI, Error) << "IPA configuration failed!"; return -EPIPE; } - if (!result.controls.empty()) { - ControlList &ctrls = result.controls; - unicam_[Unicam::Image].dev()->setControls(&ctrls); - } + if (!controls.empty()) + unicam_[Unicam::Image].dev()->setControls(&controls); /* * Configure the H/V flip controls based on the combination of