From patchwork Wed Dec 18 08:34:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22392 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 3C788C3301 for ; Wed, 18 Dec 2024 08:36:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E2B0368094; Wed, 18 Dec 2024 09:36:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="eJguW1xJ"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B22F067F24 for ; Wed, 18 Dec 2024 09:36:17 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-387897fae5dso490683f8f.2 for ; Wed, 18 Dec 2024 00:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1734510977; x=1735115777; 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=eJguW1xJN6cJLtis5AXXpin4VmpEBGPzAEy6C5ZOOqjk2uCv/SkBi9nVNBlIyzXVZM ICQMpMjxhZfuNkmL39vxqPnVuTdcxSQAdSJA4jX1l7gCe/4Ddk7c/Ag7IZbVsd6khG2i b6v3dFKtQJU1KfZza015a7a6Ywg6Rw+xewEDG8yxXcHv5usikgxOoXTZdP+iu9Qcm/BO DFwKpXqCxcnZWl7fENG/bUakFrBe2irAesxnZ8kaQ+cKmWok/sILFwDc+N/KsvfocxXP LYmMxMffb39OC/yHbmnSs6uJwy9HqS/1ePpWZWUg2WNaiMhyxTgbgzcdW4YZPgs9s/S7 fTDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734510977; x=1735115777; 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=VhB4IkV4dyEZhEXiVG/2yccUMZfptJl1zBraiupJF+XyKg7nb/YTnRhZzcqWRVJcyD HF+cJI2RIujHurYGYiLs3mN07l0wA5uVcjRtM09BVuomJsoDfGFtcbfJihI0jUB08lLl TJHZbJBqsToFe7W5syWr+DdeG0jLR+3OB0Mgrsw7VNn5fTrKkRFqB5cPPpfCBe/EyB8Z RvqoY2wD9AdG1RqkUOXllfCT80VAlop/PwdBWXD/Oeu3YNaPGjrHyqmzPGF7bSFglsxD bfaJmSZmBj98ULTqP4An5YCUZOn++WhC+MCPljtFB8xVhuXipeOysys4dFN5Xyi0V7/m b8Pg== X-Gm-Message-State: AOJu0YxvgNmAaTwXq3uT7IkKwWS9ISH8ZNyCRBDJsZuDLasNizA82HSp CGeR3Ora34AZI2pWUhZnAOd9Er0FG6cMFkErVrS2531ECwJf+rd7qilNqJSlTEu649SEaGYIre7 A X-Gm-Gg: ASbGncvEKJQNZkBRONQF+OYoj1eBgzxqeQ/QM69NFDnVn49FP7/rWNxUhQX6GhK4tho Xpnl/TKr6hOvx8STK+v1N/he3B58gAtnylWYRn+rsgDMFKrGnfVgXfredHZ50kC3YTX9VusRbMJ 0TbzsHtklu5PeWjY2/4lv+13tOLFvy+IyaPpEUQbaL1EZK39Z5+Ptd0v5tF3O/LUuD+PFc764gS u+BcAnZccO1MJkXQV8tuCTWRh/4ItiCVFlhyyCzG/lIlYah2Aq/CL7srvh7+43wyZUzLxJIPPP/ X-Google-Smtp-Source: AGHT+IHmsmojrh1Y1bPisKNHTBIxow3jokfYri9mrX1mlBb06DzbuLXfCIVlG5TaD8emM+C1JG1K+w== X-Received: by 2002:a05:600c:19d0:b0:434:f537:f9c1 with SMTP id 5b1f17b1804b1-4365540f09bmr6307445e9.9.1734510976944; Wed, 18 Dec 2024 00:36:16 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c804a2f9sm13585781f8f.77.2024.12.18.00.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 00:36:16 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart Subject: [PATCH v2 1/4] ipa: rpi: Use r-value references in the set()/setLocked() functions Date: Wed, 18 Dec 2024 08:34:18 +0000 Message-ID: <20241218083610.2397879-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218083610.2397879-1-naush@raspberrypi.com> References: <20241218083610.2397879-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); } /* From patchwork Wed Dec 18 08:34:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22393 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 73EEDC3301 for ; Wed, 18 Dec 2024 08:36:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D12566809B; Wed, 18 Dec 2024 09:36:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="E26AXai0"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 43AE967F24 for ; Wed, 18 Dec 2024 09:36:18 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-436284cdbe0so7635775e9.3 for ; Wed, 18 Dec 2024 00:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1734510977; x=1735115777; 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=IIG4zUWJV+wv/nFX9HY32UphHg0iL6nIDLZ67W++gCA=; b=E26AXai03sxzAUPcndG1LZ5n6O/3MUgWnhPkwGQZQKKKqx3EYq061pSs969gKcQ0vm c/QO1uK9mlLQzRJMlInurJoICPvP7ttZvV/s9EgyQxoj2a/xMyjih80BoTB3x3Lf6W/C 1sZKDJdXSy4sPFjDELLKG+AKihq0cJLQz95t18OUmXvRLjrjOBdnxhwEhNWaUWgF2XTB jNzQEZNOFCD/rInNSW/cH0jOaVdz70PVm3tVKZWV1XLkbnAW58dolrStZ+SFwdWxRYwk +TICSY2D68UGW2FybBJtvjpaCvr41EgK0oL1sqVEvQTyfE7Sr30DtGZH9SMtj742sYtz YgrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734510977; x=1735115777; 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=IIG4zUWJV+wv/nFX9HY32UphHg0iL6nIDLZ67W++gCA=; b=uRdOudaII7ra15hQapWL9Kjyhg5XY/sZkZSBSA+KFapDT38Tb7A3NlWmn/8MLq5a15 Ga+/Rx+UtanipCSIPqfnJwh5qFeYKVk5DkOcZFqg5u8mV5newvNjj/g5aS0LEQwOUbGp 0VSAmqcXLqtMxFMrgmlULhai88gimzhU3mGa5powR2Rd528ePTGM/MFdXQI2h+UFxqG1 WDqe1gRFi85ouuUt2so22rQ/BYNTXB58KCf3K0V0SEiyQR9tA4zAv+yML8XVjxndRSxx A9WLohonJxGC1Uoes2WFQuIGYGj6vHlYEk2ivVTQNb14i5wYx43Zgg1QwBnajxPLYOru MmAw== X-Gm-Message-State: AOJu0YzUAGgRHRBuVm0B8Cgig5BZsmkIP2fgAw2pmYc1sMhtenEb8pwo StPWHQfwH9pDzT8q8C5Cjp0SSj1CuQVuNCo1od2fvubRSin+1wX5hEngezeUfVg61PI2q5VBbrN Q X-Gm-Gg: ASbGncsYPynHjDnlo7KFg4/TrVmosYXWt3VuBAnGhD26JvHf6lw5jo6x8/Emt1xZnNB kwcfe1sIysluCqkU+RUnsda2LHbn63kgDRvW7gmCjETHYTQY71VBbqL4LsvTNjk7G/QRaGreQoJ OKoNbkmwp4OMqIKS/Qv13eb8buUwKqSCdVhKeB4hztsYM/V6Mj+zR371C0w5dKfszdG/50lCaE8 sFXLLmhldEMPS9hsRrdb0ol2jWBPpBklEk+OXf/5W+NRstkbGLYYRDWJzqDd4HOoNBt0QVzotBk X-Google-Smtp-Source: AGHT+IHpHg/mJ7H11VPfQ9StlNm7JPM4U7gh5xJ0HQ9ClBuovz2CNnixYP6bk0+usnUFEOMkMAO8Uw== X-Received: by 2002:a05:600c:5249:b0:434:f586:7535 with SMTP id 5b1f17b1804b1-436550b129amr6152215e9.0.1734510977591; Wed, 18 Dec 2024 00:36:17 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c804a2f9sm13585781f8f.77.2024.12.18.00.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 00:36:17 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart Subject: [PATCH v2 2/4] ipa: rpi: Add erase()/eraseLocked() to RPiController::Metadata Date: Wed, 18 Dec 2024 08:34:19 +0000 Message-ID: <20241218083610.2397879-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218083610.2397879-1-naush@raspberrypi.com> References: <20241218083610.2397879-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" These functions erase a key/value pair from the metadata object. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/metadata.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h index b884490918c7..77d3b0745059 100644 --- a/src/ipa/rpi/controller/metadata.h +++ b/src/ipa/rpi/controller/metadata.h @@ -91,6 +91,12 @@ public: data_.insert(other.data_.begin(), other.data_.end()); } + void erase(std::string const &tag) + { + std::scoped_lock lock(mutex_); + eraseLocked(tag); + } + template T *getLocked(std::string const &tag) { @@ -111,6 +117,14 @@ public: data_[tag] = std::forward(value); } + void eraseLocked(std::string const &tag) + { + auto it = data_.find(tag); + if (it == data_.end()) + return; + data_.erase(it); + } + /* * Note: use of (lowercase) lock and unlock means you can create scoped * locks with the standard lock classes. From patchwork Wed Dec 18 08:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22394 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 A0900C3305 for ; Wed, 18 Dec 2024 08:36:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 838A668083; Wed, 18 Dec 2024 09:36:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="OHA82nAd"; dkim-atps=neutral Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D82E68083 for ; Wed, 18 Dec 2024 09:36:19 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385db79aafbso549517f8f.1 for ; Wed, 18 Dec 2024 00:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1734510978; x=1735115778; 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=LMWk2T6O0FX1QjFHGshf9zrKq9ib51COSr3XgGiWJjk=; b=OHA82nAdfXrytQjZafDmt57XhZEgMq70KPs4pJsv722OxO5Z91xEE4d+BA5yY0DAUj IyAzstd7dYOtogQDLaOf45mC1ao5K/6Qwp4LwhgJaoSFn4WGUbqINIa7EzRsimPYtTLh iSLMfHMPFozsmXqB7A0auLb3GjlSqkjYSifaG7pbB6eyV+mx4HJC6BC8zGancoUvkbbf FkpM7FQm4lJkzYBFW07CzcUMGywMWJdX+FMn4E+7ra+b9Rh8g1N6GFtg2u3sLwdTRtLH 094rbJuOOyir207cJC0SVRRYSaE0fy21foQl+Zrc8OPUQLg0QPtcaGP/wQm3NC09+FYD ul+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734510978; x=1735115778; 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=LMWk2T6O0FX1QjFHGshf9zrKq9ib51COSr3XgGiWJjk=; b=CDlguyUJ1rlopvhX/hbbSccOMPIVaKCxkq9G2FJSAHFjOJY3CKePUXlwZYknDqCp2X qiH3yMA/BlFrGQEEf2B4VQ0rhQ62Ja17oLLr166U/AE6th7VSsiFR59bAqljxafqlFs8 OvPwUeNfEDz+eGpTrT9uf0rOQe+LqJfIRgY94EHcqqkqY/XUyOIEjHX9770XkqmUikWW cGdgCKovhr/F/P8G+uONG7++FrRA08b9F4jhLKMuNyitLaSCBrZnxJq0xwEDeYKq5c7l qEA1/Hi90VJBGAOvlcbsbV5JTuNUxrXANMzpWww1nnQzU7iQTBUq/WVYQLFlHtcwpE8Q 4fjA== X-Gm-Message-State: AOJu0YzIKqvyEvZ26gKqNbIMOseGs9u3gk2MLg5T9WD0MzZUCEEavjCf EDSBs9Kbd31v8uDSwjyxmQsGepoqJ2REJ1jn4GlKBLeeoJb/1TxlDHCdMiOUE51S3ArKhOqKOID y X-Gm-Gg: ASbGncteqHTI8G1T3e8CHljVMjnqkM9UXK6ft+1wNd0Ksm93bXSdhG9Xsmox/pxOTAb JAFpNEqFp9PDYvpRFcEDoJ/gY43teCWxLyjVftFHYg1Kzz9O7OaNeaPZwY1gJ8v02DeBouWJn2W Z4Vfnu3TNBxydHQg6HPScWVIt6dr5EWAHKm53FzrP45mOFjWhnKEdkuMJtSIN+4bdwd+kYklFQ1 c4w/0jSu0MMr2oaGl+yC9ATnzt8fl7SIzJj1qYWtWoDuLUSUEr5HiTKaEJ0XUV9CF50CDbLmVq/ X-Google-Smtp-Source: AGHT+IHPnOq2KonQgYZnb4Z9LbsnRplXfPysJ6Y85Eu8aXQD8gtp0u6s8lYtSXAQThR2mFqqGeGoDA== X-Received: by 2002:a05:6000:18a3:b0:374:ca43:ac00 with SMTP id ffacd0b85a97d-388e4d4b5f3mr599613f8f.4.1734510978372; Wed, 18 Dec 2024 00:36:18 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c804a2f9sm13585781f8f.77.2024.12.18.00.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 00:36:17 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart Subject: [PATCH v2 3/4] ipa: rpi: Add a HW property to determine if the data buffer is strided Date: Wed, 18 Dec 2024 08:34:20 +0000 Message-ID: <20241218083610.2397879-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218083610.2397879-1-naush@raspberrypi.com> References: <20241218083610.2397879-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" This property (dataBufferStrided) indicates if the CSI-2 hardware writes to the embedded/metadata buffer directly, or if it treats the buffer like an image buffer and strides the metadata lines. Unicam writes this buffer strided, while the PiSP Frontend writes to it directly. This information will be relevant to data parsers in the helpers where the data is structured in lines. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/controller.cpp | 2 ++ src/ipa/rpi/controller/controller.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/ipa/rpi/controller/controller.cpp b/src/ipa/rpi/controller/controller.cpp index e0131018e7b2..651fff632400 100644 --- a/src/ipa/rpi/controller/controller.cpp +++ b/src/ipa/rpi/controller/controller.cpp @@ -39,6 +39,7 @@ static const std::map HardwareConfigMap .pipelineWidth = 13, .statsInline = false, .minPixelProcessingTime = 0s, + .dataBufferStrided = true, } }, { @@ -71,6 +72,7 @@ static const std::map HardwareConfigMap * frames wider than ~16,000 pixels. */ .minPixelProcessingTime = 1.0us / 380, + .dataBufferStrided = false, } }, }; diff --git a/src/ipa/rpi/controller/controller.h b/src/ipa/rpi/controller/controller.h index eff520bd61de..fdb46557de9c 100644 --- a/src/ipa/rpi/controller/controller.h +++ b/src/ipa/rpi/controller/controller.h @@ -49,6 +49,7 @@ public: unsigned int pipelineWidth; bool statsInline; libcamera::utils::Duration minPixelProcessingTime; + bool dataBufferStrided; }; Controller(); From patchwork Wed Dec 18 08:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22395 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 33A0AC3301 for ; Wed, 18 Dec 2024 08:36:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C8C6B6809B; Wed, 18 Dec 2024 09:36:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="SV2/Zh6V"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E5BBD68095 for ; Wed, 18 Dec 2024 09:36:19 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38625aa01b3so592522f8f.3 for ; Wed, 18 Dec 2024 00:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1734510979; x=1735115779; 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=PIP26LxRuK+JHZPjKFeLlcD5pLgXl3eiU614VFDvcKc=; b=SV2/Zh6V+qWsOx8Rh2weiC9AMi8c6ATVGo49trKJmfxZNSpqXr5OmlZwpTFqlsPZm/ Eoe8I3/TBIg3b6Zi1GY7Z+cjbmIwAIfNK89A8OlHy7jobpnIRhnd+zfw4r1AZeR7gXZz UGXpcX69jIllW8dIeh+UA6sEH8AQ1B6yBtlABWNGEknjo4yW1TBOASJWUhs5p6aNbX+l JXSXzGO6KYcWxp8HjxZoli82wec6JfrbjHuIuxtW849dQMM8Cpitv1W4NPk/en9g5Moh IGyWw61ASdrk8reyhbQJj3e6MKUzE4d5Ta5GuFPfEyNPoGZKX9ugF3UFpECgKdCZaUxP BFXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734510979; x=1735115779; 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=PIP26LxRuK+JHZPjKFeLlcD5pLgXl3eiU614VFDvcKc=; b=SHYMSapAiPBQ4hdYiVqrvUvZXPy24BzHPQfZM4h29fzMaBN7vD9di1hybJZfa2QcLK AL+ilbUVO0nzz3mKBKvyNMkw3Dvy5WpIovN6X9vviaZDGaccPNHNqSxlx5lO63RrIS2j NSm5z1wveDyGolGKTDr64MiIJFONpHWdCOu59S4qC9dz7jfsMVCSdZJYk57fRnBq+lcm ZDJXi8NLI2belHgmPePDs9yi+CQ2rOij94KeEjwlJ7gB8UaC1vryvVjIE8qALY885OcR AY2iD19mnAgrRI4b0i5UrtGYWAgl4z9M3m8dSY8TAXWTZYsP1nco6OZLGYPlV4Z+5XO7 M5AQ== X-Gm-Message-State: AOJu0YxTFYbnUOD0EWNyblI7/JJNIBSug7THVUyPyET6tImU+Ya2tXFp jpfQcmbb13bxmf5Yu82bl4tF3YVjZdou5OuAXnboTpzbKdU4NixRW1QJqfalSANcp0xubeavVgP y X-Gm-Gg: ASbGncsosfMURjklCUUECSubJxZ1oN4DOwQLo3lVYdR0Gx+8o/FDaX7plU7JiR1Z/Og 8Y/ddE47v1nYx23pDThFso8ATQVWJu37juE4Ut9VAeoKrp8nL3han9cSIuRkvoLsIzSQPKo70l4 OoF4vQSL1R1t6e6kDfJbJTmjeq/b775qauUmlgYhIfr11FYtpSJLQjk5nfAs/zGsPBlTYEdhNz+ +zIt1BPoN3Z6M7jt87rm4ZF4+zsg59Ltc6sdeZearqVxBN73R8CLwm9dF2ydPCoG295fTVOYN4O X-Google-Smtp-Source: AGHT+IGOjcfgNOPbuuXMXJkrlfZcidrF7TrotoJz/YOz1RT6WGzq1h7irRMPST7o4N3NxeSAaormrQ== X-Received: by 2002:a5d:6c6e:0:b0:385:fa20:6583 with SMTP id ffacd0b85a97d-388e4d313f2mr561776f8f.2.1734510979046; Wed, 18 Dec 2024 00:36:19 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c804a2f9sm13585781f8f.77.2024.12.18.00.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 00:36:18 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH v2 4/4] ipa: rpi: Provide the camera helper with the hardware configuration Date: Wed, 18 Dec 2024 08:34:21 +0000 Message-ID: <20241218083610.2397879-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218083610.2397879-1-naush@raspberrypi.com> References: <20241218083610.2397879-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" Add a CamHelper::setHwConfig() helper used by the IPA to set the hardware configuration in use by the pipeline. This will be needed by the IMX500 camera helper in a future commit to determine if the metadata buffer is strided. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Acked-by: Kieran Bingham --- src/ipa/rpi/cam_helper/cam_helper.cpp | 5 +++++ src/ipa/rpi/cam_helper/cam_helper.h | 2 ++ src/ipa/rpi/common/ipa_base.cpp | 1 + 3 files changed, 8 insertions(+) diff --git a/src/ipa/rpi/cam_helper/cam_helper.cpp b/src/ipa/rpi/cam_helper/cam_helper.cpp index 6493e88232a4..1422a02e9953 100644 --- a/src/ipa/rpi/cam_helper/cam_helper.cpp +++ b/src/ipa/rpi/cam_helper/cam_helper.cpp @@ -156,6 +156,11 @@ void CamHelper::setCameraMode(const CameraMode &mode) } } +void CamHelper::setHwConfig(const Controller::HardwareConfig &hwConfig) +{ + hwConfig_ = hwConfig; +} + void CamHelper::getDelays(int &exposureDelay, int &gainDelay, int &vblankDelay, int &hblankDelay) const { diff --git a/src/ipa/rpi/cam_helper/cam_helper.h b/src/ipa/rpi/cam_helper/cam_helper.h index 4a4ab5e68cba..fb7eb3202e79 100644 --- a/src/ipa/rpi/cam_helper/cam_helper.h +++ b/src/ipa/rpi/cam_helper/cam_helper.h @@ -76,6 +76,7 @@ public: CamHelper(std::unique_ptr parser, unsigned int frameIntegrationDiff); virtual ~CamHelper(); void setCameraMode(const CameraMode &mode); + void setHwConfig(const Controller::HardwareConfig &hwConfig); virtual void prepare(libcamera::Span buffer, Metadata &metadata); virtual void process(StatisticsPtr &stats, Metadata &metadata); @@ -108,6 +109,7 @@ protected: std::unique_ptr parser_; CameraMode mode_; + Controller::HardwareConfig hwConfig_; private: /* diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index 5fce17e67bd6..165c23c88d49 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -160,6 +160,7 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams ¶ms, Ini lensPresent_ = params.lensPresent; controller_.initialise(); + helper_->setHwConfig(controller_.getHardwareConfig()); /* Return the controls handled by the IPA */ ControlInfoMap::Map ctrlMap = ipaControls;