From patchwork Wed Jan 8 11:09:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22468 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 1C879BD80A for ; Wed, 8 Jan 2025 11:10:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C83FA68503; Wed, 8 Jan 2025 12:10:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="b6no12eL"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BB5CB608AB for ; Wed, 8 Jan 2025 12:10:35 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43616bf3358so25445795e9.3 for ; Wed, 08 Jan 2025 03:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1736334635; x=1736939435; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B7RQnbyjyrsg/0lgDdzviLQ9dDzroinzgu5Rz/x5ULU=; b=b6no12eLYuke4tNoQZrZ3KSfqIUJ466y/wBVUmolBH4CwLLM6Bj4/XHCXd1vAQbpf+ j9wIR5OgN9q/4GMC5REB/Svlws+0H7LFqg1fIe/0nZ8Ph94g6zUXUHy9ykk9TiZl6wYI ZwLGG49qaUCfwAZrvPzlcsCTfeX7gL4GyGegZgsqqR1t48sSO0JeJjzor6yowZft23SE rTVZzJEjo5qg+h73lHaQOAxtMuZXEgqTYPGfqXBC2DvNMnVKeXChjnewM/9srPD8yJwp 2fw0mOoW9c8vaBn0VhpcC5BT0b1Ahi6nON61MKyoWHH1Ev4UbnrFLJnwgyMzR8S2QDco pLlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736334635; x=1736939435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B7RQnbyjyrsg/0lgDdzviLQ9dDzroinzgu5Rz/x5ULU=; b=q7Jx/iTQC6zZOafyl8Wqtj5Xn7xIO9ybQ/eda/g3LfiKTeU2rf8k+c5D2JfPSl+gda mRt2ZkC1yrxRGqM7e2oDbt7uIwCyMN1bqf1odeiuJwP9IrnqzZT4lB+2aGMAt87ZePpe GoaCKquL4N5FN3ofRpD23nZDjQrrWLe2NiPxNNBeUJhaS2Wf7Ue6U7eN/CXOKBr/NUI7 VqSBRB2S965cE5AWdq8exubH93xsRFBkQ9rpWhCSe40XkX9eAMRXKUatryHjUSXoF5jh Sxg3stwNnnNZxuhBMk9XKQvonqf3UCxQf4MzjGoWtWeA524A9ozoexrGAvnYWgNjINjl bUfw== X-Gm-Message-State: AOJu0YxAFHgtEYdfFqVQsiYam5Y84NHEzlznzyfgYVacJjwOfrdXQO+s pEN2YTxW+iJYIxB1IdNeJIWlih1cOau+FAjD14OGnJ2RON5HpW0b0VCZy2Gj1saKmYrnPI7eKO5 TuKk= X-Gm-Gg: ASbGnctECFCS0MTdIVQCoLZT5a9gfOlx2qz+lngrw1LajZyUPMr3aMut8UHyH2u4b5h O7XMO5r1IRnCfxcHJzB9R+ypjyiLqC1ccn1KlJLc9XuQiW1w1NHt0ILA8nArWunGjc2XQwHnlHj qt18+Vyl4iJBWVlCGqX5L9rQAO3c8Z6en5Iel4j9Zbu8KnkLGxIKHZ1WFXW+3+kbvSIlqmFGgIw DB/S/ygDkKZdpOeKH/pkNFEH+5snLuH2DcqH0DcFb0kpJIq+Ur/Bi3uSj84s87Qb/E3cP3asnsv X-Google-Smtp-Source: AGHT+IHUohmKQwxxP9Il3iBIfwzMhgcd/FnfmEq2eJG6P6bD1Y5Wl0B+EqUe2YwbcWaGIJrH7hrvKg== X-Received: by 2002:a05:600c:a09:b0:434:f1d5:144a with SMTP id 5b1f17b1804b1-436e2557087mr7850405e9.0.1736334635039; Wed, 08 Jan 2025 03:10:35 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddefcbsm17141325e9.22.2025.01.08.03.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 03:10:34 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart Subject: [PATCH v3 1/4] ipa: rpi: Use r-value references in the set()/setLocked() functions Date: Wed, 8 Jan 2025 11:09:33 +0000 Message-ID: <20250108111030.3257931-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250108111030.3257931-1-naush@raspberrypi.com> References: <20250108111030.3257931-1-naush@raspberrypi.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" Use an r-value reference in set() and setLocked(), allowing more efficient metadata handling with std::forward and std::move if needed. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/metadata.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h index b4650d25170f..b884490918c7 100644 --- a/src/ipa/rpi/controller/metadata.h +++ b/src/ipa/rpi/controller/metadata.h @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -36,10 +37,10 @@ public: } template - void set(std::string const &tag, T const &value) + void set(std::string const &tag, T &&value) { std::scoped_lock lock(mutex_); - data_[tag] = value; + data_[tag] = std::forward(value); } template @@ -104,10 +105,10 @@ public: } template - void setLocked(std::string const &tag, T const &value) + void setLocked(std::string const &tag, T &&value) { /* Use this only if you're holding the lock yourself. */ - data_[tag] = value; + data_[tag] = std::forward(value); } /*