[{"id":20533,"web_url":"https://patchwork.libcamera.org/comment/20533/","msgid":"<YXfVXvTJmP/+u6rr@pendragon.ideasonboard.com>","date":"2021-10-26T10:15:58","subject":"Re: [libcamera-devel] [PATCH v4 15/19] ipa: ipu3: Isolate\n\tipa_context documentation","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Oct 26, 2021 at 11:55:30AM +0200, Jean-Michel Hautbois wrote:\n> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> The IPU3 IPA core is growing with additional documentation. The\n> ipa_context documentation is stored here, but it pushes the IPU3\n> documentation and implementation further from the head of the file.\n> \n> Furthermore, the ipa_context documentation is outside of the ipa::ipu3\n> namespace and isn't identified correctly by Doxygen.\n> \n> Move the ipa_context to its own compilation object even though there\n> isn't any code, but to maintain consistency with our documentation\n> model.\n> \n> Correctly re-introduce the documentation into the libcamera::ipa::ipu3\n> namespace during the move.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipa_context.cpp | 136 +++++++++++++++++++++++++++++++++++\n>  src/ipa/ipu3/ipu3.cpp        | 124 --------------------------------\n>  src/ipa/ipu3/meson.build     |   1 +\n>  3 files changed, 137 insertions(+), 124 deletions(-)\n>  create mode 100644 src/ipa/ipu3/ipa_context.cpp\n> \n> diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\n> new file mode 100644\n> index 00000000..3e154e60\n> --- /dev/null\n> +++ b/src/ipa/ipu3/ipa_context.cpp\n> @@ -0,0 +1,136 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Google Inc.\n> + *\n> + * ipa_context.cpp - IPU3 IPA Context\n> + */\n> +\n> +#include \"ipa_context.h\"\n> +\n> +namespace libcamera::ipa::ipu3 {\n> +\n> +/**\n> + * \\file ipa_context.h\n> + * \\brief Context and state information shared between the algorithms\n> + */\n\nWe usually put the \\file block before the namespace.\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> +/**\n> + * \\struct IPASessionConfiguration::grid\n> + * \\brief Grid configuration of the IPA\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsGrid\n> + * \\brief Bayer Down Scaler grid plane config used by the kernel\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsOutputSize\n> + * \\brief BDS output size configured by the pipeline handler\n> + *\n> + * \\var IPASessionConfiguration::grid::stride\n> + * \\brief Number of cells on one line including the ImgU padding\n> + */\n> +\n> +/**\n> + * \\struct IPASessionConfiguration::agc\n> + * \\brief AGC parameters configuration of the IPA\n> + *\n> + * \\var IPASessionConfiguration::agc::minShutterSpeed\n> + * \\brief Minimum shutter speed supported with the configured sensor\n> + *\n> + * \\var IPASessionConfiguration::grid::maxShutterSpeed\n> + * \\brief Maximum shutter speed supported with the configured sensor\n> + *\n> + * \\var IPASessionConfiguration::grid::minAnalogueGain\n> + * \\brief Minimum analogue gain supported with the configured sensor\n> + *\n> + * \\var IPASessionConfiguration::grid::maxAnalogueGain\n> + * \\brief Maximum analogue gain supported with the configured sensor\n> + */\n> +\n> +/**\n> + * \\struct IPAFrameContext::agc\n> + * \\brief Context for the Automatic Gain Control algorithm\n> + *\n> + * The exposure and gain determined are expected to be applied to the sensor\n> + * at the earliest opportunity.\n> + *\n> + * \\var IPAFrameContext::agc::exposure\n> + * \\brief Exposure time expressed as a number of lines\n> + *\n> + * \\var IPAFrameContext::agc::gain\n> + * \\brief Analogue gain multiplier\n> + *\n> + * The gain should be adapted to the sensor specific gain code before applying.\n> + */\n> +\n> +/**\n> + * \\struct IPAFrameContext::awb\n> + * \\brief Context for the Automatic White Balance algorithm\n> + *\n> + * \\struct IPAFrameContext::awb::gains\n> + * \\brief White balance gains\n> + *\n> + * \\var IPAFrameContext::awb::gains::red\n> + * \\brief White balance gain for R channel\n> + *\n> + * \\var IPAFrameContext::awb::gains::green\n> + * \\brief White balance gain for G channel\n> + *\n> + * \\var IPAFrameContext::awb::gains::blue\n> + * \\brief White balance gain for B channel\n> + */\n> +\n> +/**\n> + * \\struct IPAFrameContext::toneMapping\n> + * \\brief Context for ToneMapping and Gamma control\n> + *\n> + * \\var IPAFrameContext::toneMapping::gamma\n> + * \\brief Gamma value for the LUT\n> + *\n> + * \\var IPAFrameContext::toneMapping::gammaCorrection\n> + * \\brief Per-pixel tone mapping implemented as a LUT\n> + *\n> + * The LUT structure is defined by the IPU3 kernel interface. See\n> + * <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details.\n> + */\n> +\n> +} /* namespace libcamera::ipa::ipu3 */\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 4c0fff00..a10fdd4a 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -37,130 +37,6 @@\n>  #include \"algorithms/tone_mapping.h\"\n>  #include \"libipa/camera_sensor_helper.h\"\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> -/**\n> - * \\struct IPASessionConfiguration::grid\n> - * \\brief Grid configuration of the IPA\n> - *\n> - * \\var IPASessionConfiguration::grid::bdsGrid\n> - * \\brief Bayer Down Scaler grid plane config used by the kernel\n> - *\n> - * \\var IPASessionConfiguration::grid::bdsOutputSize\n> - * \\brief BDS output size configured by the pipeline handler\n> - *\n> - * \\var IPASessionConfiguration::grid::stride\n> - * \\brief Number of cells on one line including the ImgU padding\n> - */\n> -\n> -/**\n> - * \\struct IPASessionConfiguration::agc\n> - * \\brief AGC parameters configuration of the IPA\n> - *\n> - * \\var IPASessionConfiguration::agc::minShutterSpeed\n> - * \\brief Minimum shutter speed supported with the configured sensor\n> - *\n> - * \\var IPASessionConfiguration::grid::maxShutterSpeed\n> - * \\brief Maximum shutter speed supported with the configured sensor\n> - *\n> - * \\var IPASessionConfiguration::grid::minAnalogueGain\n> - * \\brief Minimum analogue gain supported with the configured sensor\n> - *\n> - * \\var IPASessionConfiguration::grid::maxAnalogueGain\n> - * \\brief Maximum analogue gain supported with the configured sensor\n> - */\n> -\n> -/**\n> - * \\struct IPAFrameContext::agc\n> - * \\brief Context for the Automatic Gain Control algorithm\n> - *\n> - * The exposure and gain determined are expected to be applied to the sensor\n> - * at the earliest opportunity.\n> - *\n> - * \\var IPAFrameContext::agc::exposure\n> - * \\brief Exposure time expressed as a number of lines\n> - *\n> - * \\var IPAFrameContext::agc::gain\n> - * \\brief Analogue gain multiplier\n> - *\n> - * The gain should be adapted to the sensor specific gain code before applying.\n> - */\n> -\n> -/**\n> - * \\struct IPAFrameContext::awb\n> - * \\brief Context for the Automatic White Balance algorithm\n> - *\n> - * \\struct IPAFrameContext::awb::gains\n> - * \\brief White balance gains\n> - *\n> - * \\var IPAFrameContext::awb::gains::red\n> - * \\brief White balance gain for R channel\n> - *\n> - * \\var IPAFrameContext::awb::gains::green\n> - * \\brief White balance gain for G channel\n> - *\n> - * \\var IPAFrameContext::awb::gains::blue\n> - * \\brief White balance gain for B channel\n> - */\n> -\n> -/**\n> - * \\struct IPAFrameContext::toneMapping\n> - * \\brief Context for ToneMapping and Gamma control\n> - *\n> - * \\var IPAFrameContext::toneMapping::gamma\n> - * \\brief Gamma value for the LUT\n> - *\n> - * \\var IPAFrameContext::toneMapping::gammaCorrection\n> - * \\brief Per-pixel tone mapping implemented as a LUT\n> - *\n> - * The LUT structure is defined by the IPU3 kernel interface. See\n> - * <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details.\n> - */\n> -\n>  /* Minimum grid width, expressed as a number of cells */\n>  static constexpr uint32_t kMinGridWidth = 16;\n>  /* Maximum grid width, expressed as a number of cells */\n> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n> index 39320980..3194111a 100644\n> --- a/src/ipa/ipu3/meson.build\n> +++ b/src/ipa/ipu3/meson.build\n> @@ -5,6 +5,7 @@ subdir('algorithms')\n>  ipa_name = 'ipa_ipu3'\n>  \n>  ipu3_ipa_sources = files([\n> +    'ipa_context.cpp',\n>      'ipu3.cpp',\n>  ])\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 6E223BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 10:16:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D420C60237;\n\tTue, 26 Oct 2021 12:16:22 +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 9151F60123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 12:16:21 +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 E5D8C3F0;\n\tTue, 26 Oct 2021 12:16:20 +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=\"OxRZ1Z+1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635243381;\n\tbh=QS8f2k29KNXtq3qkL17yesqDv7w1gH8AUvcXmVbZKuA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OxRZ1Z+18fmc5TdV0fX980lNHnZQPjowKjKAOpcY5Ae/iH2HZPemwS4+lm6ZqAnZR\n\tM29DUyIIywhhsVSAXGP5CSr3renprc1Q/OtDrfM/qwreJs/UHl1LvUcszMfqlnnQ59\n\tzH65EEzrVUkoWCdM+Zz1WMl1XtjiMIMnmsv9gn2E=","Date":"Tue, 26 Oct 2021 13:15:58 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YXfVXvTJmP/+u6rr@pendragon.ideasonboard.com>","References":"<20211026095534.90348-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211026095534.90348-16-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211026095534.90348-16-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 15/19] ipa: ipu3: Isolate\n\tipa_context documentation","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>"}}]