From patchwork Thu Jun 16 08:07:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 16227 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 DC4D6C3273 for ; Thu, 16 Jun 2022 08:07:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4EF0F65639; Thu, 16 Jun 2022 10:07:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655366873; bh=euV/yF39BpOuZjaJiVY+D+yithOOLhpNiqE2vnFqKmk=; 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=wpUeRqrWZwYTPBeY2SJmERPr3VbEPjSIqznbMtoBzlAf+cM5SaxAoENtWIbGteZd0 0fGlTW1vgNH/6xm64bx4v3QePslBRd0Kex3CREM3qlKdQqihv/I9JYifGm2oe+hHdq Ry87tolIpTWIRw975zLuEV6kPZItLwa+Qrl/GVvtmrvwugdg3jv66XpD/r7GPt55+1 cYAaUtnJKC1d64TXu6KNQNAXzob+/w+9fxH54bY0osRXNT86NiaWisbgVXvNDjTKPg BSGlCvq79Z0QjC6LslAdbuqEvGud8idheCNxXqpfkVvI2sKFgTL7kzwE7rgqoTDX1S 9vkyZCh1nG5TA== Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3983165631 for ; Thu, 16 Jun 2022 10:07:52 +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="nYFHuv26"; dkim-atps=neutral Received: by mail-wr1-x42c.google.com with SMTP id o16so793691wra.4 for ; Thu, 16 Jun 2022 01:07:52 -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=CICC5cmHc9FKneMsR0VtXcUkA4dvYwBf2I3BKGorhfM=; b=nYFHuv26jQFLi7bRzFs4GsgMfm8WqnCPud8PKSW7o+LWztaitV1/l+jMazNQ57so+M e+jHtaqG/FJcqo5gytJEo1whDR7zqfFBVMUrxBGqpt/dQxu26fSSpxU8VeaJLIXwYb7v 9fdOuFz3kgZjN+64b5OZfVdHrfAXuxA+HQOEvmk3fe/waf/WVYZobrgPNO5QfTIakonp sa92cN8qn4ZnFkeJZHdrHYrQBqLLrE72AC3Gdk772f2TlzQ9LPegH/bJp9oJwLSoq8UL iUJJHYBqFYL5uwyI0LySzSTXDqP7S0HZeKpQM2tOpajqewcC7IPcLbG4rCnVfm2/nVOc QbvA== 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=CICC5cmHc9FKneMsR0VtXcUkA4dvYwBf2I3BKGorhfM=; b=glampjfant9CGUyQORgXr3nZw5h6R96P1oT29hPU6awMN3bdqErWXaB6RJM/W0ypry Z2PJ7qN7V3W6WPcA7USKYPC/ovllqlZl2dvZAHZM5yWbxd2d3zlnwhDmRDemr/HJ9xLB 0M+PLxLPjumBWZEoiMz7gHPvO9WQNfBD1yOBX/IklPw6QyTSwhgjwaP72e8qahI0PyYG vzHfry59XsUJwLlcU3qab0vRJadRa6FZOS9KsJlx0dOQNJ1VL8w5qyyeujPM6fPZe8bH hUShCFJMtQ7tem8imd+vlQH7UAh7kN92j0U4dmLjydhT2iVKZ6lX8oLp8mwnhKUhMykX wJ9Q== X-Gm-Message-State: AJIora8o4wPbGnuSGyIlopeSVJArPL7GOzrgn2WAwtp1vypoZShXjwpC c4Gb+tQxfhfEXsN+CViW91SaMIg82PW2HA== X-Google-Smtp-Source: AGRyM1uxt2lpJVZ8JDd3fLpYHvLI/hPw7BNor+bFkLo+P1gMtAJSPbY7/NdxMGbwsFulmI0ar+LVrw== X-Received: by 2002:a5d:6608:0:b0:21a:374d:786a with SMTP id n8-20020a5d6608000000b0021a374d786amr1298994wru.418.1655366871456; Thu, 16 Jun 2022 01:07:51 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-76-188.w2-15.abo.wanadoo.fr. [2.15.166.188]) by smtp.gmail.com with ESMTPSA id r15-20020adff70f000000b002185d79dc7fsm1098868wrp.75.2022.06.16.01.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 01:07:50 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 16 Jun 2022 10:07:40 +0200 Message-Id: <20220616080744.548995-2-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616080744.548995-1-fsylvestre@baylibre.com> References: <20220616080744.548995-1-fsylvestre@baylibre.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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..96bf09e3 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;