From patchwork Tue Aug 27 01:40:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21034 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 E4CC3C323E for ; Tue, 27 Aug 2024 01:40:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 24B9663437; Tue, 27 Aug 2024 03:40:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gq3bX9lv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D6AB861E4F for ; Tue, 27 Aug 2024 03:40:51 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AFB36B0B for ; Tue, 27 Aug 2024 03:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724722784; bh=G1ImeoAXS7tCv/Y+eHyq5itrkxDjj92MPKWzt4tOtAQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gq3bX9lvePi8w+OiZBAuWnKGyMlEslv3hxm/UrHtfeIVpc/+oandRIGwWn2ksAlPb qfnUBgtNgG/B0pvcmPSTaclwt5i8TNfDLz3nMe6p4BI7MTeKwMLwjDQo8flEFQc36g lFahqPGA1FjNZfKVZ4r3q6SXCm7FK7Dx/VJcomqM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v4 2/9] ipa: rkisp1: Pass parameters buffer format to IPA module Date: Tue, 27 Aug 2024 04:40:36 +0300 Message-ID: <20240827014044.24673-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240827014044.24673-1-laurent.pinchart@ideasonboard.com> References: <20240827014044.24673-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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" The rkisp1 driver supports two formats for the ISP parameters buffer, the legacy fixed format and the new extensible format. In preparation of support for the new format, pass the parameters buffer format from the pipeline handler to the IPA module and store it. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder --- Changes since v3: - Store parameter format in IPASessionConfiguration --- include/libcamera/ipa/rkisp1.mojom | 1 + src/ipa/rkisp1/ipa_context.cpp | 5 +++++ src/ipa/rkisp1/ipa_context.h | 1 + src/ipa/rkisp1/rkisp1.cpp | 2 ++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 1 + 5 files changed, 10 insertions(+) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 1009e970a1b5..585d38572aa2 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -11,6 +11,7 @@ import "include/libcamera/ipa/core.mojom"; struct IPAConfigInfo { libcamera.IPACameraSensorInfo sensorInfo; libcamera.ControlInfoMap sensorControls; + uint32 paramFormat; }; interface IPARkISP1Interface { diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 9f3f576afcf7..730a55b4465a 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -105,6 +105,11 @@ namespace libcamera::ipa::rkisp1 { * \brief Indicates if the camera is configured to capture raw frames */ +/** + * \var IPASessionConfiguration::paramFormat + * \brief The fourcc of the parameters buffers format + */ + /** * \struct IPAActiveState * \brief Active state for algorithms diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 061efc0c578e..24c4b2471bb4 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -59,6 +59,7 @@ struct IPASessionConfiguration { } sensor; bool raw; + uint32_t paramFormat; }; struct IPAActiveState { diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 23e0826cc335..de2998ab57fe 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -226,6 +226,8 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, context_.activeState = {}; context_.frameContexts.clear(); + context_.configuration.paramFormat = ipaConfig.paramFormat; + const IPACameraSensorInfo &info = ipaConfig.sensorInfo; const ControlInfo vBlank = sensorControls_.find(V4L2_CID_VBLANK)->second; context_.configuration.sensor.defVBlank = vBlank.def().get(); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index eec5bf949bed..1cdb9a44f900 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -814,6 +814,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) return ret; ipaConfig.sensorControls = data->sensor_->controls(); + ipaConfig.paramFormat = paramFormat.fourcc; ret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_); if (ret) {