From patchwork Tue Mar 23 12:27:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11658 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 37FC8C32E5 for ; Tue, 23 Mar 2021 12:27:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E70368D6C; Tue, 23 Mar 2021 13:27:47 +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="CqptGzeZ"; 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 5251D602D7 for ; Tue, 23 Mar 2021 13:27:45 +0100 (CET) Received: by mail-ej1-x635.google.com with SMTP id b7so26791279ejv.1 for ; Tue, 23 Mar 2021 05:27:45 -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=J030fngYYhH7A6mLzY/lY5VD3s2pUrc6fPTU9ImqEVU=; b=CqptGzeZQeZ+0cqwNgxPytPAtcET0pkuVHiICjqlPJB8wh9ZMt5BlguWBeBz/o6/pD 17kO48U7Aiq9+JXVWYuzHmJzRm5yw/V/V+yqUrRvvoDQbe36h4BAWzKGlVKOiANU6Lr5 CHW5Vs97j/+Q+kMRxXEJCuxI8+uepYIrPByMceb/2rRwhdnA8RZowyaruHAzi+E1BZPq 0hG5Gk+jJg5mtbJetImE6A2xrr619fZ7AyfPchj4FVDNIcAW4hvPJLBelMASoJowDMA4 jxZHdUJcGY4EvJI5cXYv53X7H1CAjdSjrUAu7xY5w5/SY8JjgrTm+uAjvyEnRYmJVaEN Pqcw== 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=J030fngYYhH7A6mLzY/lY5VD3s2pUrc6fPTU9ImqEVU=; b=PwYauSLTJy+JhvXYJNiKLL9gOezKk4NOfghoZ4kplO710Esqc3d9ucCP1k6B7YTb5Q k92vx3hWF3mMfqBwznFPj9jpbdU8jgTVv7nWzY9FAtYZG7TEEpfSnxFhK63QSV6cAq6x HkxSC1G4B9u7dDjHX4PxsIvvlNxyuanlFqerdbtBfwelhm4X2tHu0ybc6FgglNiIdYQc HrCAC0Kf2aFs4b7SHxk64kTSTx151J0MDekYq2zU/hc+hTrcWp9varoNYNZTEokM67fy mlNfaJ2eyo/PZD4y3MDJPgvcQjjJ82rroygDe3m6aKBUjf5G8a9/ijrs5T4WLEG+q8j9 KJEA== X-Gm-Message-State: AOAM5305I3tQSzOofWARwnek/avfGKe0YzVVvtFdZF2i1FvH0LhkvIlf 0gh1AxOtSEjuZwL3A6BS+zDOUqVCpYKNqQ== X-Google-Smtp-Source: ABdhPJyWHddAKwd912/tv/zg1zVyIcmkuNr9uMNq7ruUGNliGa6u9PEeSDobHWwqDtAOVc9iQt3AdQ== X-Received: by 2002:a17:906:3409:: with SMTP id c9mr4671918ejb.314.1616502464739; Tue, 23 Mar 2021 05:27:44 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id u13sm11082295ejy.31.2021.03.23.05.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 05:27:44 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Mar 2021 12:27:33 +0000 Message-Id: <20210323122739.680560-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323122739.680560-1-naush@raspberrypi.com> References: <20210323122739.680560-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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;