From patchwork Fri Jun 17 09:23:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 16258 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 12BEDC3273 for ; Fri, 17 Jun 2022 09:23:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C6D916563B; Fri, 17 Jun 2022 11:23:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655457830; bh=DjyNdnTjUnAW1opZVIE82vr1Mv6cwC8MwFO6kdAKzKg=; 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=WwphsiiyZOljfH2s7VkoBn5n60NQWwm4sE5IocvIpQMwHXmxiK3E6dhE+3om0nKyk z1zf3OjF8qgcS2lg0vBhMCwNDVsZvVJmp6yS9On9oetsg3Awyz7C85af/n1AWswK+g LGXjms2iV4cC9Y6xwtnttNk44dPQVfZ67woLsjg+st2yNwd1eaHLD7oVHqEewF0qPD hLAduombWlBYNkcdbXyamREb007zq7XeAuhAthGrMk85t0tdCjL2EDGq3dFJz2G5qR kOycmWjLJMV9WZ/FKYVsZQ+JSf8cY90RNLHPpQFctY1ZSB7dw8NvnsFgmiouZv/D2g 1zYLcKSGDawJw== Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 25E0D60471 for ; Fri, 17 Jun 2022 11:23:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="7vzgEbMA"; dkim-atps=neutral Received: by mail-wr1-x42b.google.com with SMTP id s1so4964723wra.9 for ; Fri, 17 Jun 2022 02:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MfOFzFspTP5zz9WTQrdkPOXwqbKdm9Kl7i0KNHA6q+0=; b=7vzgEbMA9aIeBJ2W8WX/4KGUVQFeNl5o6SgYHlzvZIE0+eJUm4vPFsxFyICFBw6yx8 deTt6YOheeLLpi0jdjcFiACm5X+//JDLLDtYn8VWzEaNAWWcS4A1MXtXzQMGxvvRkHZm PJnT3ZaF/7HMivLK6bbgSCU+3hvyJ2ESCPwz46HydpBVkEPWOt2SnQjbC926Bnu6SAdc Z/8a1SpTuhpB4aLQRZY33fGMOCLxDJso+5IV0nYHIWCumaFFi8447lbOUXOwIN5JmrEM n/gJZbX64GKT6JI9A/eelsP2tXKVrTnpmr2oXUcWaEqnHerggeHANvBhqtIp4GEUzFYz NnWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MfOFzFspTP5zz9WTQrdkPOXwqbKdm9Kl7i0KNHA6q+0=; b=xBWFQPIk6mnUr21Umz0LNPk/IAu9Au5DXYv76wkILy1sWxMwA8lNnI56NdDr7QxfE3 hQz8dq8wGDs8314Q4pfFw4LSoqXJYOOjdKT5162jXME5tHuS0eqc8jkujFiwbY0etq2D Dq04ab18ArLJOUdW5yvjIvEiJxstf43tnkOxO3X6I8oZWmgpOBlW42O0ZQw5OayJ61bI lwxOZtnIWkEUylN44FIcbfeaSS6qHheVuyPiWZr+mks3rpnSm0c+oeVEd2wWBcMkfIGm Hj0t6qMUKJPEXeptxJ29H9fstL/qq4RdM5VZJAUrHDjCJMtP+067qKwipSDbMIfDBYAy RvYA== X-Gm-Message-State: AJIora/0Uhl1iRwEWG15l8E7v5Xb/Q/FeEr4Il+N5zLQWDUo2O37k5QM KFZDsmf7OYTsWJZ8PiP04VZDGKKXvuZ7Jg== X-Google-Smtp-Source: AGRyM1snul7ONZLTTguMSftT3GIUlC1AvEkmR18IF8IRO8dCfw5RzCekKEUIJHPPwfr8BGhA7xCsMw== X-Received: by 2002:a5d:6dae:0:b0:218:4a3a:3623 with SMTP id u14-20020a5d6dae000000b002184a3a3623mr8523455wrs.524.1655457828487; Fri, 17 Jun 2022 02:23:48 -0700 (PDT) Received: from BL087.. ([2a01:e34:eea9:e630:4718:73b:d035:3786]) by smtp.gmail.com with ESMTPSA id h81-20020a1c2154000000b0039c41686421sm7962328wmh.17.2022.06.17.02.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 02:23:48 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 17 Jun 2022 11:23:11 +0200 Message-Id: <20220617092315.120781-2-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220617092315.120781-1-fsylvestre@baylibre.com> References: <20220617092315.120781-1-fsylvestre@baylibre.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/5] pipeline: rkisp1: Support IPA tuning file 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: Florian Sylvestre via libcamera-devel From: Florian Sylvestre Reply-To: Florian Sylvestre Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Allow the usage of a YAML IPA tuning file that is either defined by the sensor name (sensor_name.yaml) or defined by LIBCAMERA_RKISP1_TUNING_FILE environment variable. Signed-off-by: Florian Sylvestre Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 4b3d2cf7..59ded513 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -322,7 +322,18 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision) ipa_->paramsBufferReady.connect(this, &RkISP1CameraData::paramFilled); ipa_->metadataReady.connect(this, &RkISP1CameraData::metadataReady); - int ret = ipa_->init(IPASettings{ "", sensor_->model() }, hwRevision); + /* + * The API tuning file is made from the sensor name unless + * the environment variable overrides it. + */ + std::string ipaTunigFile; + char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RKISP1_TUNING_FILE"); + if (!configFromEnv || *configFromEnv == '\0') + ipaTunigFile = ipa_->configurationFile(sensor_->model() + ".yaml"); + else + ipaTunigFile = std::string(configFromEnv); + + int ret = ipa_->init({ ipaTunigFile, sensor_->model() }, hwRevision); if (ret < 0) { LOG(RkISP1, Error) << "IPA initialization failure"; return ret;