From patchwork Fri May 8 09:28:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26687 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 A559DBE173 for ; Fri, 8 May 2026 09:28:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E64D763029; Fri, 8 May 2026 11:28:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FOwBU0gM"; 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 455F362FE1 for ; Fri, 8 May 2026 11:28:19 +0200 (CEST) Received: from pb-laptop.local (185.221.140.217.nat.pool.zt.hu [185.221.140.217]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6B5CCBCA; Fri, 8 May 2026 11:28:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778232494; bh=BI3SjSAZondlzdkfkIM04C0kXY4bBXbfbn6fyfc1HL4=; h=From:To:Cc:Subject:Date:From; b=FOwBU0gM4mbe+f20fy6jjTv3S+QVEPr63IG8BxZ21tuDnHsSwxzTXeJol4ZXOzuJN 75oSd5OdEWFn7BsJKHz0L7HnddjArrRhWXhqHPAUmp+jI2Ljcv4YmOn7MzAlk9xkhz iXECyO5PpdGY03El0sdSQVd9yH9uLcZxU9lvfXTs= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v1 1/2] libcamera: base: bound_method: Strip qualifiers in argument pack Date: Fri, 8 May 2026 11:28:15 +0200 Message-ID: <20260508092816.119642-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.54.0 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" Having extra qualifiers, especially `const`, simply inhibits optimization opportunities as it prevents e.g. moving values out of pack object. So strip the qualifiers. Signed-off-by: Barnabás Pőcze Reviewed-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/base/bound_method.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index 91fe8b8cb9..cb642e0a9b 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -39,7 +39,7 @@ public: { } - std::tuple...> args_; + std::tuple>...> args_; R ret_; }; @@ -53,7 +53,7 @@ public: { } - std::tuple...> args_; + std::tuple>...> args_; }; class BoundMethodBase From patchwork Fri May 8 09:28:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26688 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 1F6ECBE173 for ; Fri, 8 May 2026 09:28:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76C686301E; Fri, 8 May 2026 11:28:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oWBAFuG4"; 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 8131562FE8 for ; Fri, 8 May 2026 11:28:19 +0200 (CEST) Received: from pb-laptop.local (185.221.140.217.nat.pool.zt.hu [185.221.140.217]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B221313BE for ; Fri, 8 May 2026 11:28:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778232494; bh=LK5dZHDmfWjbprygBqFvbB+gTN/Gi7GkAcu9cNMN6r8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oWBAFuG4q16QKwz/vro/Aythdn7Rx5v0dg/k+AYGHfEs3zUKKOlecPkIovoW1biWA zKCEJC/+e0MTggWrVJuiWp/wV1lPJZ/FJMGIaPBhZ6h4kIn80rBvJKHkaLCKo35EzW 0bpvByFDySnwT4861uRifI2m9XizHZ8VKZmNpvB0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 2/2] libcamera: base: bound_method: Forward when invoking Date: Fri, 8 May 2026 11:28:16 +0200 Message-ID: <20260508092816.119642-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260508092816.119642-1-barnabas.pocze@ideasonboard.com> References: <20260508092816.119642-1-barnabas.pocze@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" This implements the same kind of change for pack-based invoking as 9c86a405b72a ("libcamera: base: bound_method: Forward arguments when possible") did for the other cases. At the moment a single argument pack is used just once, hence it is safe to forward the arguments from the pack, allowing moving to take place instead of copying. So do that. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/base/bound_method.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index cb642e0a9b..9b42a8a1e8 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -97,9 +97,9 @@ private: [[maybe_unused]] auto *args = static_cast(pack); if constexpr (!std::is_void_v) - args->ret_ = invoke(std::get(args->args_)...); + args->ret_ = invoke(std::forward(std::get(args->args_))...); else - invoke(std::get(args->args_)...); + invoke(std::forward(std::get(args->args_))...); } public: