From patchwork Tue Aug 27 01:40:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21035 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 4DF7CC32D5 for ; Tue, 27 Aug 2024 01:41:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C0A4B6342D; Tue, 27 Aug 2024 03:40:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OghVScAI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F07F163421 for ; Tue, 27 Aug 2024 03:40:52 +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 44B53B0B; Tue, 27 Aug 2024 03:39:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724722786; bh=XtsO8kgy9Jj5a9SLAKjUXi6HrX53EDShIwMpQt1B1Kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OghVScAILDohuUXFiWBPC5vw7mmnmVEEDnIl9rPL9NdbUNygur3zOoKHV0JMd1c7S WxleYEdsYOsvDM8/lYvYRh2FNYii1Gg7cjEEAolqoIqOk+zMzuXPj2hIpsl2KIYccE NeAUuJNgo4TNEfMQrXCZh6l3Szzqo/gh2w8HHCxI= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi Subject: [PATCH v4 3/9] ipa: rkisp1: Pass parameters buffer size to pipeline handler Date: Tue, 27 Aug 2024 04:40:37 +0300 Message-ID: <20240827014044.24673-4-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" From: Jacopo Mondi The ISP parameters buffer currently has a fixed payload size, which is hardcoded in the pipeline handler. To prepare for support of the extensible parameters format that has a variable payload size, pass the size from the IPA module to the pipeline handler explicitly. Keep the size hardcoded to sizeof(struct rkisp1_params_cfg) for now, this will be udpated later. Signed-off-by: Jacopo Mondi Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder --- include/libcamera/ipa/rkisp1.mojom | 2 +- src/ipa/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 585d38572aa2..80d54a03aa90 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -37,7 +37,7 @@ interface IPARkISP1Interface { }; interface IPARkISP1EventInterface { - paramsBufferReady(uint32 frame); + paramsBufferReady(uint32 frame, uint32 bytesused); setSensorControls(uint32 frame, libcamera.ControlList sensorControls); metadataReady(uint32 frame, libcamera.ControlList metadata); }; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index de2998ab57fe..c36799f82b8c 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -332,7 +332,7 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) for (auto const &algo : algorithms()) algo->prepare(context_, frame, frameContext, params); - paramsBufferReady.emit(frame); + paramsBufferReady.emit(frame, sizeof(*params)); } void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId, diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 1cdb9a44f900..ef38d86dc4b4 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -110,7 +110,7 @@ public: std::unique_ptr ipa_; private: - void paramFilled(unsigned int frame); + void paramFilled(unsigned int frame, unsigned int bytesused); void setSensorControls(unsigned int frame, const ControlList &sensorControls); @@ -374,15 +374,14 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision) return 0; } -void RkISP1CameraData::paramFilled(unsigned int frame) +void RkISP1CameraData::paramFilled(unsigned int frame, unsigned int bytesused) { PipelineHandlerRkISP1 *pipe = RkISP1CameraData::pipe(); RkISP1FrameInfo *info = frameInfo_.find(frame); if (!info) return; - info->paramBuffer->_d()->metadata().planes()[0].bytesused = - sizeof(struct rkisp1_params_cfg); + info->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused; pipe->param_->queueBuffer(info->paramBuffer); pipe->stat_->queueBuffer(info->statBuffer);