From patchwork Tue Mar 23 14:36:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11667 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 C68ACC32E5 for ; Tue, 23 Mar 2021 14:36:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E05F68D74; Tue, 23 Mar 2021 15:36:19 +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="CvpXxGbf"; dkim-atps=neutral Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C06A68D65 for ; Tue, 23 Mar 2021 15:36:17 +0100 (CET) Received: by mail-ed1-x52a.google.com with SMTP id e7so23646129edu.10 for ; Tue, 23 Mar 2021 07:36:17 -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=Pzvorr6SD2Xy1ydO1rmjBLXE5yybuLLY0wcln6JsWjg=; b=CvpXxGbfc80quu7weBjisOo8rX20sfWdC7pZsrvfoKubmgNhjf2RwVll/IRwRmxZRQ p9+9pcGhs4GeO92nXEqwjdoGgBg1sAmWIBjMsvLpLPtudl1tV+2CjiM69Q9ToNe1Izw8 9FxeSOPQnskR2MLccs+YIUvvJTxzrM+h+YrqFycdsnk0KXFGVmVNMdLngMz0Mh5/acwW QfHbHEs1Rtedx9voJpw215Dbm8LsFjmwknnRh6VUaucNrP5jHBckTGiUSmjTujAxRM9Y 7tbKuFKPqFby1cghAz1t2J/jlOB+Z1VUGBTxikM6r5tval4G8BGiLNFZMDmjgi+0I+is cNbw== 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=Pzvorr6SD2Xy1ydO1rmjBLXE5yybuLLY0wcln6JsWjg=; b=kkiEdgJtumWZsBk5AZ49Wo/7dn9h+MMfh+0iWHu5bYs8DKTXsdihfU9IJYMllJXbgt xeov2dku6Nn6W/rxkg3Ibe/HIJWhxYQzaQER0LqHNCJGQdyDIZN4go4rd6TtrOn03pUB b853RaSkJRAf4H5ZznylaxFeYvPTRneLMVqCbzIjv+z+0d2N3k789e9Sus+AnUGNdaXL y7apw1i6e2+1YylzRaPLftMNZmlx45s8UOuvg2CDOkKHb0pyCNXOm+kEoP/J+gI0cUKL 6yleT6G5imCdiGvJtogwVXx6K7ETpmnuz6VaC+AIVVqiRItcYgTroJ1vQW32p7leqgCT MBag== X-Gm-Message-State: AOAM533TzyThZwq5jyDhFdYo+JlDBp+Z8W3QD72q/Y22Cn4LWOTt/ofi QA3d+Bc3njiCnGUCGhcv5O4xj8MwE7Fk+A== X-Google-Smtp-Source: ABdhPJwQPsNfkhSlfnnW8RdCXsyHfrsAAGrq5Msoc/5SucarQ6/1G/9MJxJl3nFVJQUrvvDZqdSiRA== X-Received: by 2002:aa7:da04:: with SMTP id r4mr4887289eds.343.1616510176643; Tue, 23 Mar 2021 07:36:16 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id n6sm11282430eji.37.2021.03.23.07.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 07:36:16 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Mar 2021 14:36:04 +0000 Message-Id: <20210323143610.787760-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323143610.787760-1-naush@raspberrypi.com> References: <20210323143610.787760-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 Tested-by: David Plowman Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/core.mojom | 8 ++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++- src/libcamera/pipeline/vimc/vimc.cpp | 2 +- test/ipa/ipa_interface_test.cpp | 2 +- 5 files changed, 14 insertions(+), 4 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/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 2ea13ec9e1b9..c27120710323 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1144,7 +1144,8 @@ int IPU3CameraData::loadIPA() ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction); - ipa_->init(IPASettings{}); + CameraSensor *sensor = cio2_.sensor(); + ipa_->init(IPASettings{ "", sensor->model() }); return 0; } 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;