From patchwork Tue Aug 9 14:46:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17043 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 E0784C3275 for ; Tue, 9 Aug 2022 14:46:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D810161FAA; Tue, 9 Aug 2022 16:46:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660056391; bh=IqgwJzWwZmG+4h3hxWE+ufUyPyrffDUg3JgClKRlfzM=; 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=KYhG3QCrreUe3EJr4Q2r9jEIXTppTkKR4rqZq/DyZwGyViFEuNYlUnfxutspH5YdW 3NjF9oZf8YnGIXXUfX9a5zq3ZmfPy8RHqEUR4t5q4zjt7X50asWppr24tbEd/6fCTL BQWWR6jtpAoz4GZmcpJ4k4Al+Vbh1JQtYVnwTcHq7hYRUCWD+fvTugOossbAyGaeaI LNeMx5xVxT3rjSJsVdViETh0Z/GSDexpg2/emOcV5lCFChNHjrwC/A9KjTOLwUBfIQ RKIz+ZdYyb12V1gvTxUvUQyljh62PvXeFccqPf9RAC1D9M5KxlkXqaam6Qged95jzh xAvew/IcJKr/A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CEEA663326 for ; Tue, 9 Aug 2022 16:46:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VkAhZr/D"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 656FC481 for ; Tue, 9 Aug 2022 16:46:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660056390; bh=IqgwJzWwZmG+4h3hxWE+ufUyPyrffDUg3JgClKRlfzM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VkAhZr/Dr9QZHlEDiTHCEGGMnaAdA4JW0g/a9XPldE1fXrqqIjrprgFAA4QNJRnsX zc96VZcIBOpsckkWmmMU6UW57sUxqBz45bq2ALDrtH+Lq8X0NpP2+Q5AHA0wNx97C7 gOGY4B/lo+chzYDw/rCIn5qZOOw88WDA/M5iEGOU= To: libcamera-devel@lists.libcamera.org Date: Tue, 9 Aug 2022 17:46:14 +0300 Message-Id: <20220809144617.27983-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220809144617.27983-1-laurent.pinchart@ideasonboard.com> References: <20220809144617.27983-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/4] pipeline: ipu3: 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Pass the path name of the YAML IPA tuning file to the IPA module. The file name is derived from the sensor name ("${sensor_name}.yaml"), with a fallback to "uncalibrated.yaml". Signed-off-by: Laurent Pinchart --- Changes since v1: - Drop LIBCAMERA_IPU3_TUNING_FILE --- src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 4fe52f74a68c..9df2460323c1 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1243,8 +1243,16 @@ int IPU3CameraData::loadIPA() if (ret) return ret; - ret = ipa_->init(IPASettings{ "", sensor->model() }, sensorInfo, - sensor->controls(), &ipaControls_); + /* + * The API tuning file is made from the sensor name. If the tuning file + * isn't found, fall back to the 'uncalibrated' file. + */ + std::string ipaTuningFile = ipa_->configurationFile(sensor->model() + ".yaml"); + if (ipaTuningFile.empty()) + ipaTuningFile = ipa_->configurationFile("uncalibrated.yaml"); + + ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() }, + sensorInfo, sensor->controls(), &ipaControls_); if (ret) { LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA"; return ret;