From patchwork Thu Sep 8 01:41:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17314 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 C46DAC327D for ; Thu, 8 Sep 2022 01:42:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 89910620A8; Thu, 8 Sep 2022 03:42:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662601346; bh=XHI/YYMDnKXaWp7Try6x/5ydzAneF2irlbrDSiVsVL0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hlYjlbR5o0jODCWnszneRehcNpznXk+n7TTG4a2a9Bg6c0xmAskvBjd3pTwi/x1ig LNGdHUqhIDWwNLm0bynIQt83HNp+tS6CPJdWl3y+7c+kAaBhnXM5hIABekQStyuQiF w5WeZq4GdXTsO/6ANV/u5+L3gjdasnaIcIXQpcd+Z/xMHJuGHMQFAkBAJ2ZAHly0lO y5qaCpGXlc4wUtX+hUdhGS1TojDodV6uBobz5xwrsZ/Rd+mZSwX1ltMSjh5jfxHZw2 jI1iX7CKB50KDrGWCPyn9VESP2p2SB6x7SmCONF2rwZPIFlrjg+zjgcis6SjS05Fxk miJK9651+VgZw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A7D0A6209E for ; Thu, 8 Sep 2022 03:42:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="sZ9xvGnc"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 300D7888; Thu, 8 Sep 2022 03:42:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662601344; bh=XHI/YYMDnKXaWp7Try6x/5ydzAneF2irlbrDSiVsVL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sZ9xvGncsKHVhJgW7XllurqbUAZNaarWZjRZXaADj9ttgM5N9ujWCOSDo9hBmy4lQ sEqE9FarL7058rtjp4zV6a4JaDDM7wJ0/zYDwmCk4IXaX0mgbTRNqdJeXgM1TJafvh VP208xq42Yi+oA3mPrpEWVdH+U/YNBiwF7bWL3MM= To: libcamera-devel@lists.libcamera.org Date: Thu, 8 Sep 2022 04:41:33 +0300 Message-Id: <20220908014200.28728-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220908014200.28728-1-laurent.pinchart@ideasonboard.com> References: <20220908014200.28728-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 05/32] ipa: libipa: Provide a common base for frame contexts 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Kieran Bingham Provide a common FrameContext as a base for IPA modules to inherit from. This will allow having a common set of parameters for every frame context managed by the FCQueue implementation. Signed-off-by: Kieran Bingham Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- Changes since v3: - Rename structure from IPAFrameContext to FrameContext - Move changes to IPA modules to separate patches - Make the FrameContext::frame member private --- src/ipa/libipa/fc_queue.cpp | 18 ++++++++++++++++++ src/ipa/libipa/fc_queue.h | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp index b81d497e255a..8f61c85131c9 100644 --- a/src/ipa/libipa/fc_queue.cpp +++ b/src/ipa/libipa/fc_queue.cpp @@ -20,6 +20,24 @@ namespace ipa { * \brief Queue to access per-frame Context */ +/** + * \struct FrameContext + * \brief Context for a frame + * + * The frame context stores data specific to a single frame processed by the + * IPA. Each frame processed by the IPA has a context associated with it, + * accessible through the Frame Context Queue. + * + * Fields in the frame context should reflect values and controls associated + * with the specific frame as requested by the application, and as configured by + * the hardware. Fields can be read by algorithms to determine if they should + * update any specific action for this frame, and finally to update the metadata + * control lists when the frame is fully completed. + * + * \var FrameContext::frame + * \brief The frame number + */ + /** * \class FCQueue * \brief A support class for queueing FrameContext instances through the IPA diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h index 0f3af0f3a189..d8a5b8297a70 100644 --- a/src/ipa/libipa/fc_queue.h +++ b/src/ipa/libipa/fc_queue.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include @@ -18,6 +19,15 @@ LOG_DECLARE_CATEGORY(FCQueue) namespace ipa { +template +class FCQueue; + +struct FrameContext { +private: + template friend class FCQueue; + uint32_t frame; +}; + template class FCQueue {