From patchwork Mon May 24 09:20:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 12379 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 9E7BDC3202 for ; Mon, 24 May 2021 09:20:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5B3D26891D; Mon, 24 May 2021 11:20:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="J43GHbeS"; dkim-atps=neutral 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 41752602B1 for ; Mon, 24 May 2021 11:20:33 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 931D31315; Mon, 24 May 2021 11:20:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621848032; bh=ukW/c+wG/ZubrY24ToVfvtKGEHuwZw0SiHmzzyHZ1PE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J43GHbeSDCNMVoenxBUc45WswDG92Oy2YW/Y/tIuJvHV2/XqBnlgFhQSHSqlGqcy2 PybQEaWbXFyaRmC8pXo2Lper42Q0mHPCrCZQjWwsA7Ro0dmghygsmo/pj1gFqdNglX kY2kkDwVAOpx6bbypHDdp7YHiny9Obp3EEkWZfb8= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 24 May 2021 14:50:18 +0530 Message-Id: <20210524092023.91779-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210524092023.91779-1-umang.jain@ideasonboard.com> References: <20210524092023.91779-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/6] ipa: Move core IPA interface documentation to a .cpp file 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" Moving the core.mojom documentation to its corresponding .cpp file (core_ipa_interface.cpp). This will allow Doxygen to generate the documentation for IPABuffer, IPASettings and IPAStream structures. Since the .mojom files are placed in include/ directory, the .cpp file will live in $sourcedir/src/libcamera/ipa/ - which can also contain documentation for other mojom generated IPA interfaces in subsequent commit. Also hide the constructors in generated IPA interface from doxygen, via #ifndef __DOXYGEN__. These constructors provide no major value in documenting them, instead will spew out doxygen warnings during the build. Signed-off-by: Umang Jain Acked-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- Documentation/Doxyfile.in | 8 +- Documentation/meson.build | 1 + include/libcamera/ipa/core.mojom | 72 --------------- include/libcamera/ipa/ipu3.mojom | 5 ++ include/libcamera/ipa/raspberrypi.mojom | 5 ++ include/libcamera/ipa/rkisp1.mojom | 5 ++ include/libcamera/ipa/vimc.mojom | 5 ++ src/libcamera/ipa/core_ipa_interface.cpp | 89 +++++++++++++++++++ src/libcamera/ipa/meson.build | 5 ++ src/libcamera/meson.build | 1 + .../definition_functions.tmpl | 3 + 11 files changed, 125 insertions(+), 74 deletions(-) create mode 100644 src/libcamera/ipa/core_ipa_interface.cpp create mode 100644 src/libcamera/ipa/meson.build diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index af006724..8305f56a 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -844,7 +844,6 @@ EXCLUDE = @TOP_SRCDIR@/include/libcamera/span.h \ @TOP_SRCDIR@/src/libcamera/pipeline/ \ @TOP_SRCDIR@/src/libcamera/tracepoints.cpp \ @TOP_BUILDDIR@/include/libcamera/internal/tracepoints.h \ - @TOP_BUILDDIR@/include/libcamera/ipa/ \ @TOP_BUILDDIR@/src/libcamera/proxy/ # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or @@ -861,7 +860,12 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = @TOP_BUILDDIR@/include/libcamera/ipa/*_serializer.h \ + @TOP_BUILDDIR@/include/libcamera/ipa/*_proxy.h \ + @TOP_BUILDDIR@/include/libcamera/ipa/ipu3_*.h \ + @TOP_BUILDDIR@/include/libcamera/ipa/raspberrypi_*.h \ + @TOP_BUILDDIR@/include/libcamera/ipa/rkisp1_*.h \ + @TOP_BUILDDIR@/include/libcamera/ipa/vimc_*.h \ # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/Documentation/meson.build b/Documentation/meson.build index c8521574..9ecf4dfc 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -24,6 +24,7 @@ if doxygen.found() and dot.found() doxyfile, libcamera_internal_headers, libcamera_ipa_headers, + libcamera_ipa_interfaces, libcamera_public_headers, libcamera_sources, libipa_headers, diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 6caaa63e..e49815d8 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -94,88 +94,16 @@ module libcamera; uint32 maxFrameLength; }; -/** - * \struct IPABuffer - * \brief Buffer information for the IPA interface - * - * The IPABuffer structure associates buffer memory with a unique ID. It is - * used to map buffers to the IPA with IPAInterface::mapBuffers(), after which - * buffers will be identified by their ID in the IPA interface. - */ - -/** - * \var IPABuffer::id - * \brief The buffer unique ID - * - * Buffers mapped to the IPA are identified by numerical unique IDs. The IDs - * are chosen by the pipeline handler to fulfil the following constraints: - * - * - IDs shall be positive integers different than zero - * - IDs shall be unique among all mapped buffers - * - * When buffers are unmapped with IPAInterface::unmapBuffers() their IDs are - * freed and may be reused for new buffer mappings. - */ - -/** - * \var IPABuffer::planes - * \brief The buffer planes description - * - * Stores the dmabuf handle and length for each plane of the buffer. - */ - struct IPABuffer { uint32 id; [hasFd] array planes; }; -/** - * \struct IPASettings - * \brief IPA interface initialization settings - * - * The IPASettings structure stores data passed to the IPAInterface::init() - * function. The data contains settings that don't depend on a particular camera - * or pipeline configuration and are valid for the whole life time of the IPA - * interface. - */ - -/** - * \var IPASettings::configurationFile - * \brief The name of the IPA configuration file - * - * This field may be an empty string if the IPA doesn't require a configuration - * file. - */ - - /** - * \var IPASettings::sensorModel - * \brief The sensor model name - * - * Provides the sensor model name to the IPA. - */ struct IPASettings { string configurationFile; string sensorModel; }; -/** - * \struct IPAStream - * \brief Stream configuration for the IPA interface - * - * The IPAStream structure stores stream configuration parameters needed by the - * IPAInterface::configure() method. It mirrors the StreamConfiguration class - * that is not suitable for this purpose due to not being serializable. - */ - -/** - * \var IPAStream::pixelFormat - * \brief The stream pixel format - */ - -/** - * \var IPAStream::size - * \brief The stream size in pixels - */ struct IPAStream { uint32 pixelFormat; Size size; diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom index a717b1e6..9e3cd885 100644 --- a/include/libcamera/ipa/ipu3.mojom +++ b/include/libcamera/ipa/ipu3.mojom @@ -1,5 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * \todo Document the interface as src/libcamera/ipa/ipu3_ipa_interface.cpp + * and remove the EXCLUDE_PATTERNS entry in Doxygen.in for its generation. + */ + module ipa.ipu3; import "include/libcamera/ipa/core.mojom"; diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 42321bee..770e3049 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -1,5 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * \todo Document the interface as src/libcamera/ipa/raspberrypi_ipa_interface.cpp + * and remove the EXCLUDE_PATTERNS entry in Doxygen.in for its generation. + */ + module ipa.RPi; import "include/libcamera/ipa/core.mojom"; diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index cca871a0..da6646df 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -1,5 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * \todo Document the interface as src/libcamera/ipa/rkisp1_ipa_interface.cpp + * and remove the EXCLUDE_PATTERNS entry in Doxygen.in for its generation. + */ + module ipa.rkisp1; import "include/libcamera/ipa/core.mojom"; diff --git a/include/libcamera/ipa/vimc.mojom b/include/libcamera/ipa/vimc.mojom index be4b85b8..9ffd93bb 100644 --- a/include/libcamera/ipa/vimc.mojom +++ b/include/libcamera/ipa/vimc.mojom @@ -1,5 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * \todo Document the interface as src/libcamera/ipa/vimc_ipa_interface.cpp + * and remove the EXCLUDE_PATTERNS entry in Doxygen.in for its generation. + */ + module ipa.vimc; import "include/libcamera/ipa/core.mojom"; diff --git a/src/libcamera/ipa/core_ipa_interface.cpp b/src/libcamera/ipa/core_ipa_interface.cpp new file mode 100644 index 00000000..a6711e0e --- /dev/null +++ b/src/libcamera/ipa/core_ipa_interface.cpp @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Google Inc. + * + * core_ipa_interface.cpp - Docs file for core.mojom generated header + */ + +namespace libcamera { + +/** + * \file core_ipa_interface.h + * \brief Core IPA inteface + */ + +/** + * \struct IPABuffer + * \brief Buffer information for the IPA interface + * + * The IPABuffer structure associates buffer memory with a unique ID. It is + * used to map buffers to the IPA with IPAInterface::mapBuffers(), after which + * buffers will be identified by their ID in the IPA interface. + */ + +/** + * \var IPABuffer::id + * \brief The buffer unique ID + * + * Buffers mapped to the IPA are identified by numerical unique IDs. The IDs + * are chosen by the pipeline handler to fulfil the following constraints: + * + * - IDs shall be positive integers different than zero + * - IDs shall be unique among all mapped buffers + * + * When buffers are unmapped with IPAInterface::unmapBuffers() their IDs are + * freed and may be reused for new buffer mappings. + */ + +/** + * \var IPABuffer::planes + * \brief The buffer planes description + * + * Stores the dmabuf handle and length for each plane of the buffer. + */ + +/** + * \struct IPASettings + * \brief IPA interface initialization settings + * + * The IPASettings structure stores data passed to the IPAInterface::init() + * function. The data contains settings that don't depend on a particular camera + * or pipeline configuration and are valid for the whole life time of the IPA + * interface. + */ + +/** + * \var IPASettings::configurationFile + * \brief The name of the IPA configuration file + * + * This field may be an empty string if the IPA doesn't require a configuration + * file. + */ + +/** + * \var IPASettings::sensorModel + * \brief The sensor model name + * + * Provides the sensor model name to the IPA. + */ + +/** + * \struct IPAStream + * \brief Stream configuration for the IPA interface + * + * The IPAStream structure stores stream configuration parameters needed by the + * IPAInterface::configure() method. It mirrors the StreamConfiguration class + * that is not suitable for this purpose due to not being serializable. + */ + +/** + * \var IPAStream::pixelFormat + * \brief The stream pixel format + */ + +/** + * \var IPAStream::size + * \brief The stream size in pixels + */ + +} /* namespace libcamera */ diff --git a/src/libcamera/ipa/meson.build b/src/libcamera/ipa/meson.build new file mode 100644 index 00000000..560b2fdd --- /dev/null +++ b/src/libcamera/ipa/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + +libcamera_ipa_interfaces = files([ + 'core_ipa_interface.cpp', +]) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 7bc59b84..61b5fe21 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -67,6 +67,7 @@ includes = [ libcamera_includes, ] +subdir('ipa') subdir('pipeline') subdir('proxy') diff --git a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl index cdd75f89..94bb4918 100644 --- a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl +++ b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl @@ -25,6 +25,7 @@ enum {{enum.mojom_name}} { struct {{struct.mojom_name}} { public: +#ifndef __DOXYGEN__ {{struct.mojom_name}}() {%- if struct|has_default_fields %} :{% endif %} {%- for field in struct.fields|with_default_values -%} @@ -44,6 +45,8 @@ public: {%- endfor %} { } +#endif + {% for field in struct.fields %} {{field|name}} {{field.mojom_name}}; {%- endfor %} From patchwork Mon May 24 09:20:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 12380 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 4FD8CC3200 for ; Mon, 24 May 2021 09:20:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 09F166891E; Mon, 24 May 2021 11:20:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HtKlMbJR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CD2868918 for ; Mon, 24 May 2021 11:20:36 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4084E1315; Mon, 24 May 2021 11:20:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621848035; bh=YrMy+eZig49d1lo7ruETgYmw8ku5k+6FwvaS78Ypx6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtKlMbJRLT/tOWQkpqdfB/JiFE+wSHR5Gia4ycXFAXW6nOatVdxwUvaIl7IIstGxZ ltAeV7CGCq53pRJQy4DvNQis5AFylpicghORZ0Dl19Girp4OD9vlbZLQdyRocG8HF4 zuc9O/S4SSZnf2kJ5QQDlQeKL8VNp1gK77ow5mIs= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 24 May 2021 14:50:19 +0530 Message-Id: <20210524092023.91779-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210524092023.91779-1-umang.jain@ideasonboard.com> References: <20210524092023.91779-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/6] ipa: mojom: Move CameraSensorInfo struct exclusively to IPA IPC 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" CameraSensorInfo structure is designed to pass in camera sensor related information from pipeline-handler to IPA. Since the pipeline-handler and IPA are connected via mojom IPC IPA interface, the interface itself provides a more suitable placement of CameraSensorInfo, instead of camera_sensor.h (which is a libcamera internal header ultimately, at this point). As CameraSensorInfo is already defined in core.mojom, it is just a matter of removing [skipHeader] tag to allow code-generation of CameraSensorInfo. Finally, update header paths to include CameraSensorInfo definition from IPA interfaces instead of "libcamera/internal/camera_sensor.h". Signed-off-by: Umang Jain Signed-off-by: Paul Elder Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/internal/camera_sensor.h | 17 +--- include/libcamera/ipa/core.mojom | 2 +- include/libcamera/ipa/ipa_interface.h | 2 - src/ipa/raspberrypi/raspberrypi.cpp | 1 - src/libcamera/camera_sensor.cpp | 111 --------------------- src/libcamera/ipa/core_ipa_interface.cpp | 110 ++++++++++++++++++++ 6 files changed, 112 insertions(+), 131 deletions(-) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 2a5c51a1..0905ebfa 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "libcamera/internal/formats.h" #include "libcamera/internal/log.h" @@ -24,22 +25,6 @@ namespace libcamera { class BayerFormat; class MediaEntity; -struct CameraSensorInfo { - std::string model; - - uint32_t bitsPerPixel; - - Size activeAreaSize; - Rectangle analogCrop; - Size outputSize; - - uint64_t pixelRate; - uint32_t lineLength; - - uint32_t minFrameLength; - uint32_t maxFrameLength; -}; - class CameraSensor : protected Loggable { public: diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index e49815d8..b95b3dc4 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -78,7 +78,7 @@ module libcamera; uint32 height; }; -[skipHeader] struct CameraSensorInfo { +struct CameraSensorInfo { string model; uint32 bitsPerPixel; diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index dfe1b40a..4aefaa71 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -18,8 +18,6 @@ #include #include -#include "libcamera/internal/camera_sensor.h" - namespace libcamera { /* diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 52d91db2..87774500 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -25,7 +25,6 @@ #include #include "libcamera/internal/buffer.h" -#include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/log.h" #include diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index eb84d9eb..170de827 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -33,117 +33,6 @@ namespace libcamera { LOG_DEFINE_CATEGORY(CameraSensor) -/** - * \struct CameraSensorInfo - * \brief Report the image sensor characteristics - * - * The structure reports image sensor characteristics used by IPA modules to - * tune their algorithms based on the image sensor model currently in use and - * its configuration. - * - * The reported information describes the sensor's intrinsics characteristics, - * such as its pixel array size and the sensor model name, as well as - * information relative to the currently configured mode, such as the produced - * image size and the bit depth of the requested image format. - * - * Instances of this structure are meant to be assembled by the CameraSensor - * class by inspecting the sensor static properties as well as information - * relative to the current configuration. - */ - -/** - * \var CameraSensorInfo::model - * \brief The image sensor model name - * - * The sensor model name is a free-formed string that uniquely identifies the - * sensor model. - */ - -/** - * \var CameraSensorInfo::bitsPerPixel - * \brief The number of bits per pixel of the image format produced by the - * image sensor - */ - -/** - * \var CameraSensorInfo::activeAreaSize - * \brief The size of the pixel array active area of the sensor - */ - -/** - * \var CameraSensorInfo::analogCrop - * \brief The portion of the pixel array active area which is read-out and - * processed - * - * The analog crop rectangle top-left corner is defined as the displacement - * from the top-left corner of the pixel array active area. The rectangle - * horizontal and vertical sizes define the portion of the pixel array which - * is read-out and provided to the sensor's internal processing pipeline, before - * any pixel sub-sampling method, such as pixel binning, skipping and averaging - * take place. - */ - -/** - * \var CameraSensorInfo::outputSize - * \brief The size of the images produced by the camera sensor - * - * The output image size defines the horizontal and vertical sizes of the images - * produced by the image sensor. The output image size is defined as the end - * result of the sensor's internal image processing pipeline stages, applied on - * the pixel array portion defined by the analog crop rectangle. Each image - * processing stage that performs pixel sub-sampling techniques, such as pixel - * binning or skipping, or perform any additional digital scaling concur in the - * definition of the output image size. - */ - -/** - * \var CameraSensorInfo::pixelRate - * \brief The number of pixels produced in a second - * - * To obtain the read-out time in seconds of a full line: - * - * \verbatim - lineDuration(s) = lineLength(pixels) / pixelRate(pixels per second) - \endverbatim - */ - -/** - * \var CameraSensorInfo::lineLength - * \brief Total line length in pixels - * - * The total line length in pixel clock periods, including blanking. - */ - -/** - * \var CameraSensorInfo::minFrameLength - * \brief The minimum allowable frame length in units of lines - * - * The sensor frame length comprises of active output lines and blanking lines - * in a frame. The minimum frame length value dictates the minimum allowable - * frame duration of the sensor mode. - * - * To obtain the minimum frame duration: - * - * \verbatim - frameDuration(s) = minFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) - \endverbatim - */ - -/** - * \var CameraSensorInfo::maxFrameLength - * \brief The maximum allowable frame length in units of lines - * - * The sensor frame length comprises of active output lines and blanking lines - * in a frame. The maximum frame length value dictates the maximum allowable - * frame duration of the sensor mode. - * - * To obtain the maximum frame duration: - * - * \verbatim - frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) - \endverbatim - */ - /** * \class CameraSensor * \brief A camera sensor based on V4L2 subdevices diff --git a/src/libcamera/ipa/core_ipa_interface.cpp b/src/libcamera/ipa/core_ipa_interface.cpp index a6711e0e..6c8e8505 100644 --- a/src/libcamera/ipa/core_ipa_interface.cpp +++ b/src/libcamera/ipa/core_ipa_interface.cpp @@ -86,4 +86,114 @@ namespace libcamera { * \brief The stream size in pixels */ +/** + * \struct CameraSensorInfo + * \brief Report the image sensor characteristics + * + * The structure reports image sensor characteristics used by IPA modules to + * tune their algorithms based on the image sensor model currently in use and + * its configuration. + * + * The reported information describes the sensor's intrinsics characteristics, + * such as its pixel array size and the sensor model name, as well as + * information relative to the currently configured mode, such as the produced + * image size and the bit depth of the requested image format. + * + * Instances of this structure are meant to be assembled by the CameraSensor + * class by inspecting the sensor static properties as well as information + * relative to the current configuration. + */ + +/** + * \var CameraSensorInfo::model + * \brief The image sensor model name + * + * The sensor model name is a free-formed string that uniquely identifies the + * sensor model. + */ + +/** + * \var CameraSensorInfo::bitsPerPixel + * \brief The number of bits per pixel of the image format produced by the + * image sensor + */ + +/** + * \var CameraSensorInfo::activeAreaSize + * \brief The size of the pixel array active area of the sensor + */ + +/** + * \var CameraSensorInfo::analogCrop + * \brief The portion of the pixel array active area which is read-out and + * processed + * + * The analog crop rectangle top-left corner is defined as the displacement + * from the top-left corner of the pixel array active area. The rectangle + * horizontal and vertical sizes define the portion of the pixel array which + * is read-out and provided to the sensor's internal processing pipeline, before + * any pixel sub-sampling method, such as pixel binning, skipping and averaging + * take place. + */ + +/** + * \var CameraSensorInfo::outputSize + * \brief The size of the images produced by the camera sensor + * + * The output image size defines the horizontal and vertical sizes of the images + * produced by the image sensor. The output image size is defined as the end + * result of the sensor's internal image processing pipeline stages, applied on + * the pixel array portion defined by the analog crop rectangle. Each image + * processing stage that performs pixel sub-sampling techniques, such as pixel + * binning or skipping, or perform any additional digital scaling concur in the + * definition of the output image size. + */ + +/** + * \var CameraSensorInfo::pixelRate + * \brief The number of pixels produced in a second + * + * To obtain the read-out time in seconds of a full line: + * + * \verbatim + lineDuration(s) = lineLength(pixels) / pixelRate(pixels per second) + \endverbatim + */ + +/** + * \var CameraSensorInfo::lineLength + * \brief Total line length in pixels + * + * The total line length in pixel clock periods, including blanking. + */ + +/** + * \var CameraSensorInfo::minFrameLength + * \brief The minimum allowable frame length in units of lines + * + * The sensor frame length comprises of active output lines and blanking lines + * in a frame. The minimum frame length value dictates the minimum allowable + * frame duration of the sensor mode. + * + * To obtain the minimum frame duration: + * + * \verbatim + frameDuration(s) = minFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) + \endverbatim + */ + +/** + * \var CameraSensorInfo::maxFrameLength + * \brief The maximum allowable frame length in units of lines + * + * The sensor frame length comprises of active output lines and blanking lines + * in a frame. The maximum frame length value dictates the maximum allowable + * frame duration of the sensor mode. + * + * To obtain the maximum frame duration: + * + * \verbatim + frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) + \endverbatim + */ } /* namespace libcamera */ From patchwork Mon May 24 09:20:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 12381 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 ACB3CC3200 for ; Mon, 24 May 2021 09:20:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7202A68925; Mon, 24 May 2021 11:20:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Rn4137k8"; dkim-atps=neutral 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 38875602B1 for ; Mon, 24 May 2021 11:20:39 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 520AB1315; Mon, 24 May 2021 11:20:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621848038; bh=OFGDrnWN1SZ8XCboZpI8TqgNdcWgjlhNdHWKwAEN7Mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rn4137k89bUbtWGwG71N2/jQnexI5aCzXZGSnI+nhAxCTbVyu/Yp5mpA5DvwER/M5 wMwhIRzdrUCiFw8ySQ0lsXRFPSoVD7Z6+t4l34nh32vbXEy65y9xTg5vIJiRimariq XvcP9OScMR0B6wp+/LGdIVgeCCqcSl5VxGteBAg0= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 24 May 2021 14:50:20 +0530 Message-Id: <20210524092023.91779-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210524092023.91779-1-umang.jain@ideasonboard.com> References: <20210524092023.91779-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/6] ipa: ipc: Rename CameraSensorInfo to IPACameraSensorInfo 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 matches the naming convention for IPA IPC. Signed-off-by: Umang Jain Acked-by: Paul Elder Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- Documentation/guides/ipa.rst | 8 ++++---- include/libcamera/internal/camera_sensor.h | 2 +- include/libcamera/ipa/core.mojom | 2 +- include/libcamera/ipa/raspberrypi.mojom | 2 +- include/libcamera/ipa/rkisp1.mojom | 2 +- src/ipa/ipu3/ipu3_agc.cpp | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++---- src/ipa/rkisp1/rkisp1.cpp | 6 +++--- src/libcamera/camera_sensor.cpp | 6 +++--- src/libcamera/ipa/core_ipa_interface.cpp | 20 +++++++++---------- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++-- .../pipeline/raspberrypi/raspberrypi.cpp | 4 ++-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Documentation/guides/ipa.rst b/Documentation/guides/ipa.rst index cbffbd9a..6195b2b7 100644 --- a/Documentation/guides/ipa.rst +++ b/Documentation/guides/ipa.rst @@ -74,11 +74,11 @@ serialization, any custom data containers must be defined with the mojo IDL. The following list of libcamera objects are supported in the interface definition, and may be used as function parameter types or struct field types: -- libcamera.CameraSensorInfo - libcamera.ControlInfoMap - libcamera.ControlList - libcamera.FileDescriptor - libcamera.IPABuffer +- libcamera.IPACameraSensorInfo - libcamera.IPASettings - libcamera.IPAStream - libcamera.Point @@ -208,7 +208,7 @@ The following is an example of a main interface definition: start() => (int32 ret); stop(); - configure(libcamera.CameraSensorInfo sensorInfo, + configure(libcamera.IPACameraSensorInfo sensorInfo, map streamConfig, map entityControls, ConfigInput ipaConfig) @@ -470,7 +470,7 @@ definition: .. code-block:: none - configure(libcamera.CameraSensorInfo sensorInfo, + configure(libcamera.IPACameraSensorInfo sensorInfo, uint32 exampleNumber, map streamConfig, map entityControls, @@ -481,7 +481,7 @@ We will need to implement a function with the following function signature: .. code-block:: C++ - int configure(const CameraSensorInfo &sensorInfo, + int configure(const IPACameraSensorInfo &sensorInfo, uint32_t exampleNumber, const std::map &streamConfig, const std::map &entityControls, diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 0905ebfa..cf6c1c1e 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -51,7 +51,7 @@ public: V4L2Subdevice *device() { return subdev_.get(); } const ControlList &properties() const { return properties_; } - int sensorInfo(CameraSensorInfo *info) const; + int sensorInfo(IPACameraSensorInfo *info) const; void updateControlInfo(); diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index b95b3dc4..34a799c2 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -78,7 +78,7 @@ module libcamera; uint32 height; }; -struct CameraSensorInfo { +struct IPACameraSensorInfo { string model; uint32 bitsPerPixel; diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 770e3049..db1f689f 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -68,7 +68,7 @@ interface IPARPiInterface { * The \a ipaConfig and \a controls parameters carry data passed by the * pipeline handler to the IPA and back. */ - configure(libcamera.CameraSensorInfo sensorInfo, + configure(libcamera.IPACameraSensorInfo sensorInfo, map streamConfig, map entityControls, IPAConfig ipaConfig) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index da6646df..55fa43be 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -34,7 +34,7 @@ interface IPARkISP1Interface { start() => (int32 ret); stop(); - configure(libcamera.CameraSensorInfo sensorInfo, + configure(libcamera.IPACameraSensorInfo sensorInfo, map streamConfig, map entityControls) => (int32 ret); diff --git a/src/ipa/ipu3/ipu3_agc.cpp b/src/ipa/ipu3/ipu3_agc.cpp index ca54d89a..8bae423f 100644 --- a/src/ipa/ipu3/ipu3_agc.cpp +++ b/src/ipa/ipu3/ipu3_agc.cpp @@ -39,7 +39,7 @@ static constexpr uint32_t kMaxGain = kMaxISO / 100; static constexpr uint32_t kMinExposure = 1; static constexpr uint32_t kMaxExposure = 1976; -/* \todo those should be get from CameraSensorInfo ! */ +/* \todo those should be got from IPACameraSensorInfo ! */ /* line duration in microseconds */ static constexpr double kLineDuration = 16.8; static constexpr double kMaxExposureTime = kMaxExposure * kLineDuration; diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 87774500..e5bb8159 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -89,7 +89,7 @@ public: void start(const ControlList &controls, ipa::RPi::StartConfig *startConfig) override; void stop() override {} - int configure(const CameraSensorInfo &sensorInfo, + int configure(const IPACameraSensorInfo &sensorInfo, const std::map &streamConfig, const std::map &entityControls, const ipa::RPi::IPAConfig &data, @@ -101,7 +101,7 @@ public: void signalIspPrepare(const ipa::RPi::ISPConfig &data) override; private: - void setMode(const CameraSensorInfo &sensorInfo); + void setMode(const IPACameraSensorInfo &sensorInfo); bool validateSensorControls(); bool validateIspControls(); void queueRequest(const ControlList &controls); @@ -278,7 +278,7 @@ void IPARPi::start(const ControlList &controls, ipa::RPi::StartConfig *startConf lastRunTimestamp_ = 0; } -void IPARPi::setMode(const CameraSensorInfo &sensorInfo) +void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo) { mode_.bitdepth = sensorInfo.bitsPerPixel; mode_.width = sensorInfo.outputSize.width; @@ -323,7 +323,7 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo) mode_.max_frame_length = sensorInfo.maxFrameLength; } -int IPARPi::configure(const CameraSensorInfo &sensorInfo, +int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls, const ipa::RPi::IPAConfig &ipaConfig, diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 6d45673c..b47ea324 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -37,7 +37,7 @@ public: int start() override; void stop() override {} - int configure(const CameraSensorInfo &info, + int configure(const IPACameraSensorInfo &info, const std::map &streamConfig, const std::map &entityControls) override; void mapBuffers(const std::vector &buffers) override; @@ -90,12 +90,12 @@ int IPARkISP1::start() } /** - * \todo The RkISP1 pipeline currently provides an empty CameraSensorInfo + * \todo The RkISP1 pipeline currently provides an empty IPACameraSensorInfo * if the connected sensor does not provide enough information to properly * assemble one. Make sure the reported sensor information are relevant * before accessing them. */ -int IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info, +int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info, [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls) { diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 170de827..0fb8a258 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -205,7 +205,7 @@ int CameraSensor::validateSensorDriver() * * Failures in reading any of the targets are not deemed to be fatal, * but some properties and features, like constructing a - * CameraSensorInfo for the IPA module, won't be supported. + * IPACameraSensorInfo for the IPA module, won't be supported. * * \todo Make support for selection targets mandatory as soon as all * test platforms have been updated. @@ -674,7 +674,7 @@ int CameraSensor::setControls(ControlList *ctrls) * * \return 0 on success, a negative error code otherwise */ -int CameraSensor::sensorInfo(CameraSensorInfo *info) const +int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const { if (!bayerFormat_) return -EINVAL; @@ -701,7 +701,7 @@ int CameraSensor::sensorInfo(CameraSensorInfo *info) const } /* - * CameraSensorInfo::analogCrop::x and CameraSensorInfo::analogCrop::y + * IPACameraSensorInfo::analogCrop::x and IPACameraSensorInfo::analogCrop::y * are defined relatively to the active pixel area, while V4L2's * TGT_CROP target is defined in respect to the full pixel array. * diff --git a/src/libcamera/ipa/core_ipa_interface.cpp b/src/libcamera/ipa/core_ipa_interface.cpp index 6c8e8505..6ab689cd 100644 --- a/src/libcamera/ipa/core_ipa_interface.cpp +++ b/src/libcamera/ipa/core_ipa_interface.cpp @@ -87,7 +87,7 @@ namespace libcamera { */ /** - * \struct CameraSensorInfo + * \struct IPACameraSensorInfo * \brief Report the image sensor characteristics * * The structure reports image sensor characteristics used by IPA modules to @@ -105,7 +105,7 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::model + * \var IPACameraSensorInfo::model * \brief The image sensor model name * * The sensor model name is a free-formed string that uniquely identifies the @@ -113,18 +113,18 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::bitsPerPixel + * \var IPACameraSensorInfo::bitsPerPixel * \brief The number of bits per pixel of the image format produced by the * image sensor */ /** - * \var CameraSensorInfo::activeAreaSize + * \var IPACameraSensorInfo::activeAreaSize * \brief The size of the pixel array active area of the sensor */ /** - * \var CameraSensorInfo::analogCrop + * \var IPACameraSensorInfo::analogCrop * \brief The portion of the pixel array active area which is read-out and * processed * @@ -137,7 +137,7 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::outputSize + * \var IPACameraSensorInfo::outputSize * \brief The size of the images produced by the camera sensor * * The output image size defines the horizontal and vertical sizes of the images @@ -150,7 +150,7 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::pixelRate + * \var IPACameraSensorInfo::pixelRate * \brief The number of pixels produced in a second * * To obtain the read-out time in seconds of a full line: @@ -161,14 +161,14 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::lineLength + * \var IPACameraSensorInfo::lineLength * \brief Total line length in pixels * * The total line length in pixel clock periods, including blanking. */ /** - * \var CameraSensorInfo::minFrameLength + * \var IPACameraSensorInfo::minFrameLength * \brief The minimum allowable frame length in units of lines * * The sensor frame length comprises of active output lines and blanking lines @@ -183,7 +183,7 @@ namespace libcamera { */ /** - * \var CameraSensorInfo::maxFrameLength + * \var IPACameraSensorInfo::maxFrameLength * \brief The maximum allowable frame length in units of lines * * The sensor frame length comprises of active output lines and blanking lines diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index ade8ffbd..98c6160f 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -544,7 +544,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) if (ret) return ret; - CameraSensorInfo sensorInfo; + IPACameraSensorInfo sensorInfo; cio2->sensor()->sensorInfo(&sensorInfo); data->cropRegion_ = sensorInfo.analogCrop; @@ -883,7 +883,7 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) if (ret) return ret; - CameraSensorInfo sensorInfo{}; + IPACameraSensorInfo sensorInfo{}; ret = sensor->sensorInfo(&sensorInfo); if (ret) return ret; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 0a71325a..aa4a0e72 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -211,7 +211,7 @@ public: BayerFormat::Order nativeBayerOrder_; /* For handling digital zoom. */ - CameraSensorInfo sensorInfo_; + IPACameraSensorInfo sensorInfo_; Rectangle ispCrop_; /* crop in ISP (camera mode) pixels */ Rectangle scalerCrop_; /* crop in sensor native pixels */ Size ispMinCropSize_; @@ -1276,7 +1276,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) ipaConfig.lsTableHandle = lsTable_; } - /* We store the CameraSensorInfo for digital zoom calculations. */ + /* We store the IPACameraSensorInfo for digital zoom calculations. */ int ret = sensor_->sensorInfo(&sensorInfo_); if (ret) { LOG(RPI, Error) << "Failed to retrieve camera sensor info"; diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index adebe8b5..6699839c 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -648,7 +648,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) return ret; /* Inform IPA of stream configuration and sensor controls. */ - CameraSensorInfo sensorInfo = {}; + IPACameraSensorInfo sensorInfo = {}; ret = data->sensor_->sensorInfo(&sensorInfo); if (ret) { /* \todo Turn this into a hard failure. */ From patchwork Mon May 24 09:20:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 12382 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 A6FBDC3200 for ; Mon, 24 May 2021 09:20:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 68B266891D; Mon, 24 May 2021 11:20:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="d48ZpC1J"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE40F602B1 for ; Mon, 24 May 2021 11:20:44 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D765D1315; Mon, 24 May 2021 11:20:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621848044; bh=nrFmuM7lJywRiNys/ivIZk3OCn7tJujVrp9ZNhYM6XQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d48ZpC1JizetLFEW0FCqj9ouB9oI2KZABTzQbe3zRkwDjBUssdVOtPG/U3+NsZpdL vfDWI8EC6e4TxHwhELVzkEEnwD9XBIHy2F9lWAXWwW1Rw3qDOxp5D4hOBZtHsSTXUm kIkrVq+5h3LysrfbFPNI7vO0gDd57SGOQzzYKnE0= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 24 May 2021 14:50:22 +0530 Message-Id: <20210524092023.91779-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210524092023.91779-1-umang.jain@ideasonboard.com> References: <20210524092023.91779-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 5/6] ipa: ipu3: Introduce IPAConfigInfo in IPC 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" IPAConfigInfo is a consolidated data structure passed from IPU3 pipeline-handler to IPU3 IPA. The structure can be extended with additional parameters to accommodate the requirements of multiple IPU3 IPA modules. Adapt the in-tree IPU3 IPA to use IPAConfigInfo as well. Signed-off-by: Umang Jain Reviewed-by: Jacopo Mondi Reviewed-by: Jean-Michel Hautbois Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/ipu3.mojom | 10 ++++++++-- src/ipa/ipu3/ipu3.cpp | 14 ++++++-------- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom index 9e3cd885..6b6b431f 100644 --- a/include/libcamera/ipa/ipu3.mojom +++ b/include/libcamera/ipa/ipu3.mojom @@ -30,13 +30,19 @@ struct IPU3Action { libcamera.ControlList controls; }; +struct IPAConfigInfo { + libcamera.IPACameraSensorInfo sensorInfo; + map entityControls; + libcamera.Size bdsOutputSize; + libcamera.Size iif; +}; + interface IPAIPU3Interface { init(libcamera.IPASettings settings) => (int32 ret); start() => (int32 ret); stop(); - configure(map entityControls, - libcamera.Size bdsOutputSize) => (); + configure(IPAConfigInfo configInfo) => (); mapBuffers(array buffers); unmapBuffers(array ids); diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index f5343547..769c24d3 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -43,8 +43,7 @@ public: int start() override; void stop() override {} - void configure(const std::map &entityControls, - const Size &bdsOutputSize) override; + void configure(const IPAConfigInfo &configInfo) override; void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; @@ -139,13 +138,12 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize) << (int)bdsGrid_.height << " << " << (int)bdsGrid_.block_height_log2 << ")"; } -void IPAIPU3::configure(const std::map &entityControls, - const Size &bdsOutputSize) +void IPAIPU3::configure(const IPAConfigInfo &configInfo) { - if (entityControls.empty()) + if (configInfo.entityControls.empty()) return; - ctrls_ = entityControls.at(0); + ctrls_ = configInfo.entityControls.at(0); const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE); if (itExp == ctrls_.end()) { @@ -169,10 +167,10 @@ void IPAIPU3::configure(const std::map &entityControls params_ = {}; - calculateBdsGrid(bdsOutputSize); + calculateBdsGrid(configInfo.bdsOutputSize); awbAlgo_ = std::make_unique(); - awbAlgo_->initialise(params_, bdsOutputSize, bdsGrid_); + awbAlgo_->initialise(params_, configInfo.bdsOutputSize, bdsGrid_); agcAlgo_ = std::make_unique(); agcAlgo_->initialise(bdsGrid_); diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 98c6160f..5b15ca90 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -633,9 +633,13 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; } - std::map entityControls; - entityControls.emplace(0, data->cio2_.sensor()->controls()); - data->ipa_->configure(entityControls, config->imguConfig().bds); + ipa::ipu3::IPAConfigInfo configInfo; + configInfo.entityControls.emplace(0, data->cio2_.sensor()->controls()); + configInfo.sensorInfo = sensorInfo; + configInfo.bdsOutputSize = config->imguConfig().bds; + configInfo.iif = config->imguConfig().iif; + + data->ipa_->configure(configInfo); return 0; }