From patchwork Thu Jul 17 22:05:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 23844 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 33147BE175 for ; Thu, 17 Jul 2025 22:05:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8E7668F8D; Fri, 18 Jul 2025 00:05:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="roapOM5R"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 29DB868F70 for ; Fri, 18 Jul 2025 00:05:55 +0200 (CEST) Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FA1755A; Fri, 18 Jul 2025 00:05:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1752789920; bh=GOGEc5TZG9NjOJaS4uTVyAoIwEoeubyWQ7hCnUMvues=; h=From:To:Cc:Subject:Date:From; b=roapOM5Ro1UKS9O+9wgcY4oWJZDM9V5pII0QyOPUpafSsYNKfjrMVS3bTYCS4GUTJ mScjhjTo56IbIchG7zlQG0c80Ydx79oNkV57lFmPHEtvX+BVJD9vKRFWhwZhLgnaHJ mX6aV7zap2KH+GKFSx1hdKrOsH+NOchclr83dzEI= From: Daniel Scally To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH 1/2] libcamera: mali-c55: Set bytesused appropriately Date: Thu, 17 Jul 2025 23:05:38 +0100 Message-Id: <20250717220539.2434556-1-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 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" At the moment the mali-c55 pipeline handler sets bytesused for a buffer to be the maximum possible size (i.e. the size of a struct mali_c55_params_buffer). This is not really in keeping with the goal of the extensible parameters formats, and will not work with the new framework for those formats. Update the IPA module and pipeline handler to set bytesused to the size of the parameters that were actually supplied rather than the maximum possible size. Signed-off-by: Daniel Scally --- include/libcamera/ipa/mali-c55.mojom | 2 +- src/ipa/mali-c55/mali-c55.cpp | 3 ++- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/libcamera/ipa/mali-c55.mojom b/include/libcamera/ipa/mali-c55.mojom index 5d7eb4ee..39b7f1f1 100644 --- a/include/libcamera/ipa/mali-c55.mojom +++ b/include/libcamera/ipa/mali-c55.mojom @@ -28,7 +28,7 @@ interface IPAMaliC55Interface { }; interface IPAMaliC55EventInterface { - paramsComputed(uint32 request); + paramsComputed(uint32 request, uint32 bytesused); statsProcessed(uint32 request, libcamera.ControlList metadata); setSensorControls(libcamera.ControlList sensorControls); }; diff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp index c6941a95..5877f299 100644 --- a/src/ipa/mali-c55/mali-c55.cpp +++ b/src/ipa/mali-c55/mali-c55.cpp @@ -346,7 +346,8 @@ void IPAMaliC55::fillParams(unsigned int request, ASSERT(params->total_size <= MALI_C55_PARAMS_MAX_SIZE); } - paramsComputed.emit(request); + size_t bytesused = offsetof(struct mali_c55_params_buffer, data) + params->total_size; + paramsComputed.emit(request, bytesused); } void IPAMaliC55::processStats(unsigned int request, unsigned int bufferId, diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 4acc091b..17ad2055 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -618,7 +618,7 @@ public: void imageBufferReady(FrameBuffer *buffer); void paramsBufferReady(FrameBuffer *buffer); void statsBufferReady(FrameBuffer *buffer); - void paramsComputed(unsigned int requestId); + void paramsComputed(unsigned int requestId, uint32_t bytesused); void statsProcessed(unsigned int requestId, const ControlList &metadata); bool match(DeviceEnumerator *enumerator) override; @@ -1494,7 +1494,7 @@ void PipelineHandlerMaliC55::statsBufferReady(FrameBuffer *buffer) sensorControls); } -void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId) +void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId, uint32_t bytesused) { MaliC55FrameInfo &frameInfo = frameInfoMap_[requestId]; Request *request = frameInfo.request; @@ -1505,8 +1505,7 @@ void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId) * video devices. */ - frameInfo.paramBuffer->_d()->metadata().planes()[0].bytesused = - sizeof(struct mali_c55_params_buffer); + frameInfo.paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused; params_->queueBuffer(frameInfo.paramBuffer); stats_->queueBuffer(frameInfo.statBuffer); From patchwork Thu Jul 17 22:05:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 23845 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 0C523BE175 for ; Thu, 17 Jul 2025 22:06:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 896F268F89; Fri, 18 Jul 2025 00:05:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DK2j48iY"; 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 4D55E68F7D for ; Fri, 18 Jul 2025 00:05:55 +0200 (CEST) Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CF3E178C; Fri, 18 Jul 2025 00:05:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1752789920; bh=jfCe4aKA1+dVGIzuFV9tNhx4YwoktjAfRis9D0tfbHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DK2j48iYya0fzhbm8MYgFf9PsZhYjwkvKf0n92ioctBVABOp2cjxWNzqDnGU7qXL2 2G8JfIbkN05MjODZE5wQSpR/m11nYtNSnPNLOlIAKWthhP4poEZ5/Nfu7+praCJVAg dRrNPCtHO86UxxWXK5GveOZ8IU3gPh5P2ePustI8= From: Daniel Scally To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH 2/2] libcamera: mali-c55: Correct expected entity function Date: Thu, 17 Jul 2025 23:05:39 +0100 Message-Id: <20250717220539.2434556-2-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250717220539.2434556-1-dan.scally@ideasonboard.com> References: <20250717220539.2434556-1-dan.scally@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 mali-c55 pipeline handler currently looks for a media entity with the function MEDIA_ENT_F_IO_V4L to recognise a memory input subdevice. This is apparently intended for video device entities, and we should be looking for MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER. Correct the entity function that the pipeline handler looks for. Signed-off-by: Daniel Scally --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 17ad2055..25540ba1 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -1709,7 +1709,7 @@ bool PipelineHandlerMaliC55::match(DeviceEnumerator *enumerator) * * MEDIA_ENT_F_CAM_SENSOR - The test pattern generator * MEDIA_ENT_F_VID_IF_BRIDGE - A CSI-2 receiver - * MEDIA_ENT_F_IO_V4L - An input device + * MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER - An input device * * The last one will be unsupported for now. The TPG is relatively easy, * we just register a Camera for it. If we have a CSI-2 receiver we need @@ -1735,7 +1735,7 @@ bool PipelineHandlerMaliC55::match(DeviceEnumerator *enumerator) return registered; break; - case MEDIA_ENT_F_IO_V4L: + case MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER: LOG(MaliC55, Warning) << "Memory input not yet supported"; break; default: