From patchwork Tue Sep 27 02:36:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17416 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 2E042C0DA4 for ; Tue, 27 Sep 2022 02:37:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ADEFC62279; Tue, 27 Sep 2022 04:37:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664246230; bh=+QKdoT3OJ4NYtAL13TtxZDMryhUFdej5MafYs5tGmcU=; 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=XtmhJhsfH2Q/ixb57bD7IPT+lMnaZIMMZEd1HEpnGrG2PHLaL5xg7zedVqRdQsxxz NKtYrGUwTW5eFU8OzRmCxCJBsKT7g2aQdCsiL4XNQCTE/txmrqr9Tx+IysE5mFyZsd JbwUGV9/WdvnHZeAB7ls/Q+srPuJ1T1gr6gYVnlWCikOt1gN88sco9TeXXZxav31lk CgK6Nvtz0YfXKvP3TVIlsGuz/RBWS9Y7riAqDB6WhcHyAUD3iPt62NJTVG/3S+crTm wiL9mXAx5OsCvrnRYCIPQ0O4HP4I6ZUZXKWaD9A9WLZpk5O9uqN7BwM5xHIa3mZ3xB B/5LZ61jZD1MQ== 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 7169462270 for ; Tue, 27 Sep 2022 04:37:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VVRVqXvR"; 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 E0EE647C; Tue, 27 Sep 2022 04:37:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664246227; bh=+QKdoT3OJ4NYtAL13TtxZDMryhUFdej5MafYs5tGmcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VVRVqXvRiK5iFXq965XYyq8kjBcRruHjrRqSgHmhuVOruEBiDq8GkMvUEKu7hqatX LAJWLeyxzbxexEy4cT6s04QHrP9TNPt+a4A7mW945QZJxbRi/RJrabgX3FfutLhd86 S5+lgSGyWAvIb9ZsqKKE4fCVzelv5tnPIDD9xKQc= To: libcamera-devel@lists.libcamera.org Date: Tue, 27 Sep 2022 05:36:14 +0300 Message-Id: <20220927023642.12341-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> References: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 05/33] 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 Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- Changes since v4: - Move documentation paragraph from previous patch to this one - Rename IPAFrameContext to FrameContext in documentation 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 | 22 ++++++++++++++++++++++ src/ipa/libipa/fc_queue.h | 10 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp index 57a369512554..e812faa505a5 100644 --- a/src/ipa/libipa/fc_queue.cpp +++ b/src/ipa/libipa/fc_queue.cpp @@ -20,6 +20,24 @@ namespace ipa { * \brief Queue of per-frame contexts */ +/** + * \struct FrameContext + * \brief Context for a frame + * + * The frame context stores data specific to a single frame processed by the + * IPA module. Each frame processed by the IPA module 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 managing FrameContext instances in IPA modules @@ -65,6 +83,10 @@ namespace ipa { * allowed to overflow, which must be ensured by pipeline handlers never * queuing more in-flight requests to the IPA module than the queue size. If an * overflow condition is detected, the queue will log a fatal error. + * + * IPA module-specific frame context implementations shall inherit from the + * FrameContext base class to support the minimum required features for a + * FrameContext. */ /** diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h index 4f5cb5d35253..a589e7e1031b 100644 --- a/src/ipa/libipa/fc_queue.h +++ b/src/ipa/libipa/fc_queue.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include @@ -17,6 +18,15 @@ LOG_DECLARE_CATEGORY(FCQueue) namespace ipa { +template +class FCQueue; + +struct FrameContext { +private: + template friend class FCQueue; + uint32_t frame; +}; + template class FCQueue {