From patchwork Wed Mar 17 10:02:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11604 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 6CFA7BD80C for ; Wed, 17 Mar 2021 10:02:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0DAD468D6F; Wed, 17 Mar 2021 11:02:28 +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="k30veogi"; dkim-atps=neutral Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 198CF68D6F for ; Wed, 17 Mar 2021 11:02:23 +0100 (CET) Received: by mail-ed1-x52d.google.com with SMTP id e7so1460832edu.10 for ; Wed, 17 Mar 2021 03:02:23 -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=FiNZ1SciFIOdshBjGE/x40KQu+usIIXzXc0GHR1wiiE=; b=k30veogiGCVBG5vA/r18W6lD+HLr9XHXiRInKhlmgz6kv5lRyQJk7N4L/R8Jy0xPvU ApZt+2tqYSEmxLH13iYYvmajtfQpD1WQsDZsYxbDFjmiO/E6W53B9dRNupKKBa47b2xW vrN4Sy8pVsZAzsbGHtSC/MLfqMQhXj8csyUk1LUwqzK7HAF4SN476I8dO6GpviV15b2C 1SpQzx5kksRN1d8FCLn7WeiIWXb64uCDyr93QkDhT+s0iwGiQVujkv4fZUrBZBlwE0Qq MJ9skP/sMZBPQG//hsuJbXO3GIatI6CSwMGiJAS5gkTNRNCnEcFjsn1DGIALWn67uUgy SWQg== 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=FiNZ1SciFIOdshBjGE/x40KQu+usIIXzXc0GHR1wiiE=; b=l9DdlG0ClzZkoXSdVcemwMmmWN72TOzx8QZdf8V5IE3aCqEnBVhQq3xpWz+dpP58Er JN8b5/ybDR7ku25gEIgZaCUwWbkcG9LnHPN8nUcQvkbIrzSMvbAVX/9A6mEJVqwYnXhj CYfBDi4hQrXFwms4eMIAaS0HPUGJ6BWtjEsr61Ax7Pp+wRqyeJTegzssNQYWmnGze9SF gbp/BP0ohGKaCjyWCIoPMS9xvTX8f5B9d1pOR0bs8DBEhy4hNz3GL2pSvfXUSqKCkEbL sKC/P656tt5ir0YaFqUEZH/rh12FE+cGpPm/jiYunvGretUoLNTKM+sRk+Iiga+n4xYT Ehkg== X-Gm-Message-State: AOAM532fwpIH24CbodRq6dzMH24H69FKgwjFxtoftce/tYASsZhcPMz8 uqpRhMSAyfLhhc8pK9tWtbu/fqu5crlpHQ== X-Google-Smtp-Source: ABdhPJyNrQ/VwhH+yPcuvU7gKJFh8CUZpg3BPs967QVYsaYHoeOcG3kBzUFV10wWt3OWNHUR6o8Yrg== X-Received: by 2002:aa7:c74a:: with SMTP id c10mr40481270eds.332.1615975338033; Wed, 17 Mar 2021 03:02:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 03:02:17 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Mar 2021 10:02:05 +0000 Message-Id: <20210317100211.1067585-2-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 1/7] ipa: Add sensor model string to IPASettings 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" Pass the sensor model string to the IPA init() method through the IPASettings structure. Signed-off-by: Naushir Patuck --- include/libcamera/ipa/core.mojom | 8 ++++++++ src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++- src/libcamera/pipeline/vimc/vimc.cpp | 2 +- test/ipa/ipa_interface_test.cpp | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 5236a672461c..5363f1c5b48b 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -145,8 +145,16 @@ struct IPABuffer { * This field may be an empty string if the IPA doesn't require a configuration * file. */ + + /** + * \var IPASettings::sensorModel + * \brief The sensor model name + * + * Provides the sensor model name to the IPA. + */ struct IPASettings { string configurationFile; + string sensorModel; }; /** diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 00fa62c972ed..2c8ae31a28ad 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1227,7 +1227,8 @@ int RPiCameraData::loadIPA() ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls); ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls); - IPASettings settings(ipa_->configurationFile(sensor_->model() + ".json")); + IPASettings settings(ipa_->configurationFile(sensor_->model() + ".json"), + sensor_->model()); return ipa_->init(settings); } diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 57c65b021c46..2dfb63ecf2ef 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -425,7 +425,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) data->ipa_ = IPAManager::createIPA(this, 0, 0); if (data->ipa_ != nullptr) { std::string conf = data->ipa_->configurationFile("vimc.conf"); - data->ipa_->init(IPASettings{ conf }); + data->ipa_->init(IPASettings{ conf, data->sensor_->model() }); } else { LOG(VIMC, Warning) << "no matching IPA found"; } diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 4b88806f8f67..d6ca6f5137b0 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -104,7 +104,7 @@ protected: /* Test initialization of IPA module. */ std::string conf = ipa_->configurationFile("vimc.conf"); - int ret = ipa_->init(IPASettings{ conf }); + int ret = ipa_->init(IPASettings{ conf, "vimc" }); if (ret < 0) { cerr << "IPA interface init() failed" << endl; return TestFail;