[{"id":18951,"web_url":"https://patchwork.libcamera.org/comment/18951/","msgid":"<1d87d00e-3c30-8b36-0257-83c6597c8026@ideasonboard.com>","date":"2021-08-19T15:24:32","subject":"Re: [libcamera-devel] [PATCH v4 2/9] ipa: ipu3: Introduce a Context\n\tstructure","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 19/08/2021 15:57, Jean-Michel Hautbois wrote:\n> An increasing amount of data and information needs to be shared between\n> the components that build up to implement image processing algorithms.\n> \n> Create a context structure which will allow us to work towards calling\n> algorithms in a modular way, and sharing information between the modules.\n> \n> The IPA context is a global context set at configure time (IPAConfiguration)\n\nThis is now (IPASessionConfiguration)\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> and a per-frame context (IPAFrameContext) used while streaming.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipa_context.h | 32 ++++++++++++++++++++++++++\n>  src/ipa/ipu3/ipu3.cpp      | 46 ++++++++++++++++++++++++++++++++++++++\n>  2 files changed, 78 insertions(+)\n>  create mode 100644 src/ipa/ipu3/ipa_context.h\n> \n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> new file mode 100644\n> index 00000000..2706d3ca\n> --- /dev/null\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -0,0 +1,32 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Google Inc.\n> + *\n> + * ipu3_ipa_context.h - IPU3 IPA Context\n> + *\n> + */\n> +#ifndef __LIBCAMERA_IPU3_IPA_CONTEXT_H__\n> +#define __LIBCAMERA_IPU3_IPA_CONTEXT_H__\n> +\n> +#include <linux/intel-ipu3.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::ipu3 {\n> +\n> +struct IPASessionConfiguration {\n> +};\n> +\n> +struct IPAFrameContext {\n> +};\n> +\n> +struct IPAContext {\n> +\tIPASessionConfiguration configuration;\n> +\tIPAFrameContext frameContext;\n> +};\n> +\n> +} /* namespace ipa::ipu3 */\n> +\n> +} /* namespace libcamera*/\n> +\n> +#endif /* __LIBCAMERA_IPU3_IPA_CONTEXT_H__ */\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index c34fa460..a4359d3e 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -36,6 +36,52 @@\n>  static constexpr uint32_t kMaxCellWidthPerSet = 160;\n>  static constexpr uint32_t kMaxCellHeightPerSet = 56;\n>  \n> +/**\n> + * \\file ipa_context.h\n> + * \\brief Context and state information shared between the algorithms\n> + */\n> +\n> +/**\n> + * \\struct IPASessionConfiguration\n> + * \\brief Session configuration for the IPA module\n> + *\n> + * The session configuration contains all IPA configuration parameters that\n> + * remain constant during the capture session, from IPA module start to stop.\n> + * It is typically set during the configure() operation of the IPA module, but\n> + * may also be updated in the start() operation.\n> + */\n> +\n> +/**\n> + * \\struct IPAFrameContext\n> + * \\brief Per-frame context for algorithms\n> + *\n> + * The frame context stores data specific to a single frame processed by the\n> + * IPA. Each frame processed by the IPA has a context associated with it,\n> + * accessible through the IPAContext structure.\n> + *\n> + * \\todo Detail how to access contexts for a particular frame\n> + *\n> + * Each of the fields in the frame context belongs to either a specific\n> + * algorithm, or to the top-level IPA module. A field may be read by any\n> + * algorithm, but should only be written by its owner.\n> + */\n> +\n> +/**\n> + * \\struct IPAContext\n> + * \\brief Global IPA context data shared between all algorithms\n> + *\n> + * \\var IPAContext::configuration\n> + * \\brief The IPA session configuration, immutable during the session\n> + *\n> + * \\var IPAContext::frameContext\n> + * \\brief The frame context for the frame being processed\n> + *\n> + * \\todo While the frame context is supposed to be per-frame, this\n> + * single frame context stores data related to both the current frame\n> + * and the previous frames, with fields being updated as the algorithms\n> + * are run. This needs to be turned into real per-frame data storage.\n> + */\n> +\n>  namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(IPAIPU3)\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 95E1EBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Aug 2021 15:24:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 57E6868895;\n\tThu, 19 Aug 2021 17:24:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E65760264\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Aug 2021 17:24:34 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 07DE6DD;\n\tThu, 19 Aug 2021 17:24:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ImAgoPMv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629386674;\n\tbh=HVlfSRsmGKhF69afO2Ai2n8DRuA3lF6e5UAuSOcHu04=;\n\th=From:Subject:To:References:Date:In-Reply-To:From;\n\tb=ImAgoPMvbdSQPKsha/eitmfZqorEN8SRyUIe15s4GChK3O6e3lBMFHf4GOD2MK5jF\n\t4S5Fgxgsaz9oee3hS9I5IjnSgzP6G9MYYv5YUC0fo3iXNfppeDmUhiihWwK63jlw+I\n\tZcm8T5y2lZruHzJsPS8pVJ/V+oUeO0rGid+AlcCc=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210819145759.184192-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210819145759.184192-3-jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<1d87d00e-3c30-8b36-0257-83c6597c8026@ideasonboard.com>","Date":"Thu, 19 Aug 2021 16:24:32 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210819145759.184192-3-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v4 2/9] ipa: ipu3: Introduce a Context\n\tstructure","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18957,"web_url":"https://patchwork.libcamera.org/comment/18957/","msgid":"<YR7ywC073+toKpFM@pendragon.ideasonboard.com>","date":"2021-08-20T00:09:36","subject":"Re: [libcamera-devel] [PATCH v4 2/9] ipa: ipu3: Introduce a Context\n\tstructure","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Thu, Aug 19, 2021 at 04:57:52PM +0200, Jean-Michel Hautbois wrote:\n> An increasing amount of data and information needs to be shared between\n> the components that build up to implement image processing algorithms.\n> \n> Create a context structure which will allow us to work towards calling\n> algorithms in a modular way, and sharing information between the modules.\n> \n> The IPA context is a global context set at configure time (IPAConfiguration)\n\nAs Kieran mentioned, this is now called IPASessionConfiguration.\n\n> and a per-frame context (IPAFrameContext) used while streaming.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipa_context.h | 32 ++++++++++++++++++++++++++\n>  src/ipa/ipu3/ipu3.cpp      | 46 ++++++++++++++++++++++++++++++++++++++\n>  2 files changed, 78 insertions(+)\n>  create mode 100644 src/ipa/ipu3/ipa_context.h\n> \n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> new file mode 100644\n> index 00000000..2706d3ca\n> --- /dev/null\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -0,0 +1,32 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Google Inc.\n> + *\n> + * ipu3_ipa_context.h - IPU3 IPA Context\n> + *\n> + */\n> +#ifndef __LIBCAMERA_IPU3_IPA_CONTEXT_H__\n> +#define __LIBCAMERA_IPU3_IPA_CONTEXT_H__\n> +\n> +#include <linux/intel-ipu3.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::ipu3 {\n> +\n> +struct IPASessionConfiguration {\n> +};\n> +\n> +struct IPAFrameContext {\n> +};\n> +\n> +struct IPAContext {\n> +\tIPASessionConfiguration configuration;\n> +\tIPAFrameContext frameContext;\n> +};\n> +\n> +} /* namespace ipa::ipu3 */\n> +\n> +} /* namespace libcamera*/\n> +\n> +#endif /* __LIBCAMERA_IPU3_IPA_CONTEXT_H__ */\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index c34fa460..a4359d3e 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -36,6 +36,52 @@\n>  static constexpr uint32_t kMaxCellWidthPerSet = 160;\n>  static constexpr uint32_t kMaxCellHeightPerSet = 56;\n\nI'd move the documentation about those two lines.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n> +/**\n> + * \\file ipa_context.h\n> + * \\brief Context and state information shared between the algorithms\n> + */\n> +\n> +/**\n> + * \\struct IPASessionConfiguration\n> + * \\brief Session configuration for the IPA module\n> + *\n> + * The session configuration contains all IPA configuration parameters that\n> + * remain constant during the capture session, from IPA module start to stop.\n> + * It is typically set during the configure() operation of the IPA module, but\n> + * may also be updated in the start() operation.\n> + */\n> +\n> +/**\n> + * \\struct IPAFrameContext\n> + * \\brief Per-frame context for algorithms\n> + *\n> + * The frame context stores data specific to a single frame processed by the\n> + * IPA. Each frame processed by the IPA has a context associated with it,\n> + * accessible through the IPAContext structure.\n> + *\n> + * \\todo Detail how to access contexts for a particular frame\n> + *\n> + * Each of the fields in the frame context belongs to either a specific\n> + * algorithm, or to the top-level IPA module. A field may be read by any\n> + * algorithm, but should only be written by its owner.\n> + */\n> +\n> +/**\n> + * \\struct IPAContext\n> + * \\brief Global IPA context data shared between all algorithms\n> + *\n> + * \\var IPAContext::configuration\n> + * \\brief The IPA session configuration, immutable during the session\n> + *\n> + * \\var IPAContext::frameContext\n> + * \\brief The frame context for the frame being processed\n> + *\n> + * \\todo While the frame context is supposed to be per-frame, this\n> + * single frame context stores data related to both the current frame\n> + * and the previous frames, with fields being updated as the algorithms\n> + * are run. This needs to be turned into real per-frame data storage.\n> + */\n> +\n>  namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(IPAIPU3)","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 036AFBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Aug 2021 00:09:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5D12968895;\n\tFri, 20 Aug 2021 02:09:46 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99E5A68886\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Aug 2021 02:09:44 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 103CC8F;\n\tFri, 20 Aug 2021 02:09:43 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AZLDIF86\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629418184;\n\tbh=D2D0akux7Fn/UypVuUU34hw70meSKLAMkHYAeDc9sPs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AZLDIF86vDkT8p07yNWleWVpk5UaL8zs0eE3UGvDgU5yiiTNo7G8h6DpW4firPfYu\n\tqqmfDrDr/3BJbB7k04EM8L0FR13abIY3EODmOlh+DvbG+WRlhh5Yc/K8oZtI+AQI64\n\tEkzxA9+bvq52EwXGMK9FIbIDfQabYS/QVjXJlWa8=","Date":"Fri, 20 Aug 2021 03:09:36 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YR7ywC073+toKpFM@pendragon.ideasonboard.com>","References":"<20210819145759.184192-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210819145759.184192-3-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210819145759.184192-3-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 2/9] ipa: ipu3: Introduce a Context\n\tstructure","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]