From patchwork Fri Aug 15 11:33:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24130 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 DA06FBEFBE for ; Fri, 15 Aug 2025 11:34:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 114A269251; Fri, 15 Aug 2025 13:34:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OXoSPGL+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B1D7461443 for ; Fri, 15 Aug 2025 13:34:20 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 5DAE7605; Fri, 15 Aug 2025 13:33:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755257605; bh=Yq/hjF53Cfq75Wcu0WMfSpoPssbtJPnaa4T75Rl64gI=; h=From:To:Cc:Subject:Date:From; b=OXoSPGL+PVDs75jshxPkW1NV+YsaEQUiv9JbIZ3CStJD1vcd1AADiyh8Jibnp2Qtg IX5ZWwBvmfEGo7+R/pyBX8r9zxUmLxybTyCeVW3zFzz091kVxlq+1x5TpvTB4bmgh0 f1eyoK31zzcjFgC/mGPHKnRsrjLES1x05725e0i4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Daniel_R=C3=A1kos?= Subject: [PATCH v2 0/8] libcamera: Use span in FrameBuffer & assorted cleanups Date: Fri, 15 Aug 2025 14:33:52 +0300 Message-ID: <20250815113400.20623-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.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" Hello, This patch series is the second version of the standalone "[PATCH] libcamera: framebuffer: Replace vector with span in constructor" patch. It addresses an oversight in v1, where I forgot to convert the FrameBuffer::planes() function to return a span. The first 7 patches are a consequence of that change. With FrameBuffer::planes() returning a span, multiple callers have the be modified through libcamera. While fixing the compilation issues, I noticed a set of small issues that patches 1/8 to 7/8 improve. Splitting them in separate patches also reduces the code changes in 8/8 and makes it easier to review. Patches 1/8 to 5/8 and 7/8 are just small drive-by improvements. Please see individual patches for details. A bit worthier of notice is patch 6/8 that changes the way the IPA data structures are constructed, leading to possible optimizations. Compared to v1, the FrameBuffer::planes() class now returns a span. Required changes to callers are outlined in the patch. This changes the libcamera ABI and API, requiring recompilation and possibly code changes. Laurent Pinchart (8): libcamera: v4l2_videodevice: Avoid repeated calls to FrameBuffer::planes() pipeline: ipu3: Drop unneeded forward declarations pipeline: rkisp1: Replace error handling gotos with utils::exit_scope pipeline: rpi: Use structured bindings in range-based for loop pipelines: Use lambda functions to factor out buffer mapping code utils: codegen: ipc: Optimize constructors of IPA interface structures apps: cam: drm: Drop unneeded local variable libcamera: framebuffer: Replace vector with span in constructor include/libcamera/framebuffer.h | 4 +- include/libcamera/internal/framebuffer.h | 3 +- .../mm/cros_frame_buffer_allocator.cpp | 2 +- .../mm/generic_frame_buffer_allocator.cpp | 2 +- src/apps/cam/drm.cpp | 4 +- src/libcamera/framebuffer.cpp | 10 ++--- src/libcamera/pipeline/ipu3/frames.h | 4 -- src/libcamera/pipeline/ipu3/ipu3.cpp | 19 +++++--- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 27 ++++++----- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 45 ++++++++++--------- .../pipeline/rpi/common/pipeline_base.cpp | 10 +++-- src/libcamera/pipeline/vimc/vimc.cpp | 5 ++- src/libcamera/pipeline/virtual/virtual.cpp | 3 +- src/libcamera/v4l2_videodevice.cpp | 13 +++--- .../definition_functions.tmpl | 4 +- 15 files changed, 84 insertions(+), 71 deletions(-) base-commit: af43c2f945c42cc7d111de63abed9ca3df830ca4 --- Regards, Laurent Pinchart