pipeline: ipa: raspberrypi: Refactor and move the Raspberry Pi code
Split the Raspberry Pi pipeline handler and IPA source code into common and VC4/BCM2835 specific file structures. For the pipeline handler, the common code files now live in src/libcamera/pipeline/rpi/common/ and the VC4-specific files in src/libcamera/pipeline/rpi/vc4/. For the IPA, the common code files now live in src/ipa/rpi/{cam_helper,controller}/ and the vc4 specific files in src/ipa/rpi/vc4/. With this change, the camera tuning files are now installed under share/libcamera/ipa/rpi/vc4/. To build the pipeline and IPA, the meson configuration options have now changed from "raspberrypi" to "rpi/vc4": meson setup build -Dipas=rpi/vc4 -Dpipelines=rpi/vc4 Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
46aefed208
commit
726e9274ea
121 changed files with 172 additions and 109 deletions
|
@ -7,7 +7,7 @@ Files: Documentation/theme/static/search.png
|
|||
Copyright: 2022 Fonticons, Inc.
|
||||
License: CC-BY-4.0
|
||||
|
||||
Files: src/ipa/raspberrypi/data/*.json
|
||||
Files: src/ipa/rpi/vc4/data/*.json
|
||||
utils/raspberrypi/ctt/ctt_config_example.json
|
||||
utils/raspberrypi/ctt/ctt_ref.pgm
|
||||
Copyright: 2019-2020 Raspberry Pi Ltd
|
||||
|
|
|
@ -40,7 +40,7 @@ LIBCAMERA_IPA_MODULE_PATH
|
|||
LIBCAMERA_RPI_CONFIG_FILE
|
||||
Define a custom configuration file to use in the Raspberry Pi pipeline handler.
|
||||
|
||||
Example value: ``/usr/local/share/libcamera/pipeline/raspberrypi/minimal_mem.yaml``
|
||||
Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``
|
||||
|
||||
Further details
|
||||
---------------
|
||||
|
@ -143,7 +143,7 @@ contain tuning parameters for the algorithms, in JSON format.
|
|||
The ``LIBCAMERA_IPA_CONFIG_PATH`` variable can be used to specify custom
|
||||
storage locations to search for those configuration files.
|
||||
|
||||
`Examples <https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/raspberrypi/data>`__
|
||||
`Examples <https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/rpi/vc4/data>`__
|
||||
|
||||
IPA module
|
||||
~~~~~~~~~~
|
||||
|
|
|
@ -288,7 +288,7 @@ with dedicated pipeline handlers:
|
|||
|
||||
- Intel IPU3 (ipu3)
|
||||
- Rockchip RK3399 (rkisp1)
|
||||
- RaspberryPi 3 and 4 (raspberrypi)
|
||||
- RaspberryPi 3 and 4 (rpi/vc4)
|
||||
|
||||
Furthermore, generic platform support is provided for the following:
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ to the libcamera build options in the top level ``meson_options.txt``.
|
|||
|
||||
option('pipelines',
|
||||
type : 'array',
|
||||
choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc', 'vivid'],
|
||||
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
|
||||
description : 'Select which pipeline handlers to include')
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h',
|
|||
pipeline_ipa_mojom_mapping = {
|
||||
'ipu3': 'ipu3.mojom',
|
||||
'rkisp1': 'rkisp1.mojom',
|
||||
'raspberrypi': 'raspberrypi.mojom',
|
||||
'rpi/vc4': 'raspberrypi.mojom',
|
||||
'vimc': 'vimc.mojom',
|
||||
}
|
||||
|
||||
|
|
|
@ -194,8 +194,8 @@ arch_x86 = ['x86', 'x86_64']
|
|||
pipelines_support = {
|
||||
'imx8-isi': arch_arm,
|
||||
'ipu3': arch_x86,
|
||||
'raspberrypi': arch_arm,
|
||||
'rkisp1': arch_arm,
|
||||
'rpi/vc4': arch_arm,
|
||||
'simple': arch_arm,
|
||||
'uvcvideo': ['any'],
|
||||
'vimc': ['test'],
|
||||
|
|
|
@ -27,7 +27,7 @@ option('gstreamer',
|
|||
|
||||
option('ipas',
|
||||
type : 'array',
|
||||
choices : ['ipu3', 'raspberrypi', 'rkisp1', 'vimc'],
|
||||
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'vimc'],
|
||||
description : 'Select which IPA modules to build')
|
||||
|
||||
option('lc-compliance',
|
||||
|
@ -43,8 +43,8 @@ option('pipelines',
|
|||
'auto',
|
||||
'imx8-isi',
|
||||
'ipu3',
|
||||
'raspberrypi',
|
||||
'rkisp1',
|
||||
'rpi/vc4',
|
||||
'simple',
|
||||
'uvcvideo',
|
||||
'vimc'
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
ipa_name = 'ipa_rpi'
|
||||
|
||||
rpi_ipa_deps = [
|
||||
libcamera_private,
|
||||
libatomic,
|
||||
]
|
||||
|
||||
rpi_ipa_includes = [
|
||||
ipa_includes,
|
||||
libipa_includes,
|
||||
include_directories('controller')
|
||||
]
|
||||
|
||||
rpi_ipa_sources = files([
|
||||
'raspberrypi.cpp',
|
||||
'md_parser_smia.cpp',
|
||||
'cam_helper.cpp',
|
||||
'cam_helper_ov5647.cpp',
|
||||
'cam_helper_imx219.cpp',
|
||||
'cam_helper_imx290.cpp',
|
||||
'cam_helper_imx296.cpp',
|
||||
'cam_helper_imx477.cpp',
|
||||
'cam_helper_imx519.cpp',
|
||||
'cam_helper_imx708.cpp',
|
||||
'cam_helper_ov9281.cpp',
|
||||
'controller/controller.cpp',
|
||||
'controller/histogram.cpp',
|
||||
'controller/algorithm.cpp',
|
||||
'controller/rpi/af.cpp',
|
||||
'controller/rpi/alsc.cpp',
|
||||
'controller/rpi/awb.cpp',
|
||||
'controller/rpi/sharpen.cpp',
|
||||
'controller/rpi/black_level.cpp',
|
||||
'controller/rpi/geq.cpp',
|
||||
'controller/rpi/noise.cpp',
|
||||
'controller/rpi/lux.cpp',
|
||||
'controller/rpi/agc.cpp',
|
||||
'controller/rpi/dpc.cpp',
|
||||
'controller/rpi/ccm.cpp',
|
||||
'controller/rpi/contrast.cpp',
|
||||
'controller/rpi/sdn.cpp',
|
||||
'controller/pwl.cpp',
|
||||
'controller/device_status.cpp',
|
||||
])
|
||||
|
||||
mod = shared_module(ipa_name,
|
||||
[rpi_ipa_sources, libcamera_generated_ipa_headers],
|
||||
name_prefix : '',
|
||||
include_directories : rpi_ipa_includes,
|
||||
dependencies : rpi_ipa_deps,
|
||||
link_with : libipa,
|
||||
install : true,
|
||||
install_dir : ipa_install_dir)
|
||||
|
||||
if ipa_sign_module
|
||||
custom_target(ipa_name + '.so.sign',
|
||||
input : mod,
|
||||
output : ipa_name + '.so.sign',
|
||||
command : [ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@'],
|
||||
install : false,
|
||||
build_by_default : true)
|
||||
endif
|
||||
|
||||
subdir('data')
|
||||
|
||||
ipa_names += ipa_name
|
|
@ -13,7 +13,7 @@
|
|||
#include <libcamera/base/span.h>
|
||||
#include <libcamera/base/utils.h>
|
||||
|
||||
#include "camera_mode.h"
|
||||
#include "controller/camera_mode.h"
|
||||
#include "controller/controller.h"
|
||||
#include "controller/metadata.h"
|
||||
#include "md_parser.h"
|
26
src/ipa/rpi/cam_helper/meson.build
Normal file
26
src/ipa/rpi/cam_helper/meson.build
Normal file
|
@ -0,0 +1,26 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
rpi_ipa_cam_helper_sources = files([
|
||||
'cam_helper.cpp',
|
||||
'cam_helper_ov5647.cpp',
|
||||
'cam_helper_imx219.cpp',
|
||||
'cam_helper_imx290.cpp',
|
||||
'cam_helper_imx296.cpp',
|
||||
'cam_helper_imx477.cpp',
|
||||
'cam_helper_imx519.cpp',
|
||||
'cam_helper_imx708.cpp',
|
||||
'cam_helper_ov9281.cpp',
|
||||
'md_parser_smia.cpp',
|
||||
])
|
||||
|
||||
rpi_ipa_cam_helper_includes = [
|
||||
include_directories('..'),
|
||||
]
|
||||
|
||||
rpi_ipa_cam_helper_deps = [
|
||||
libcamera_private,
|
||||
]
|
||||
|
||||
rpi_ipa_cam_helper_lib = static_library('rpi_ipa_cam_helper', rpi_ipa_cam_helper_sources,
|
||||
include_directories : rpi_ipa_cam_helper_includes,
|
||||
dependencies : rpi_ipa_cam_helper_deps)
|
29
src/ipa/rpi/controller/meson.build
Normal file
29
src/ipa/rpi/controller/meson.build
Normal file
|
@ -0,0 +1,29 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
rpi_ipa_controller_sources = files([
|
||||
'algorithm.cpp',
|
||||
'controller.cpp',
|
||||
'device_status.cpp',
|
||||
'histogram.cpp',
|
||||
'pwl.cpp',
|
||||
'rpi/af.cpp',
|
||||
'rpi/agc.cpp',
|
||||
'rpi/alsc.cpp',
|
||||
'rpi/awb.cpp',
|
||||
'rpi/black_level.cpp',
|
||||
'rpi/ccm.cpp',
|
||||
'rpi/contrast.cpp',
|
||||
'rpi/dpc.cpp',
|
||||
'rpi/geq.cpp',
|
||||
'rpi/lux.cpp',
|
||||
'rpi/noise.cpp',
|
||||
'rpi/sdn.cpp',
|
||||
'rpi/sharpen.cpp',
|
||||
])
|
||||
|
||||
rpi_ipa_controller_deps = [
|
||||
libcamera_private,
|
||||
]
|
||||
|
||||
rpi_ipa_controller_lib = static_library('rpi_ipa_controller', rpi_ipa_controller_sources,
|
||||
dependencies : rpi_ipa_controller_deps)
|
13
src/ipa/rpi/meson.build
Normal file
13
src/ipa/rpi/meson.build
Normal file
|
@ -0,0 +1,13 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
subdir('cam_helper')
|
||||
subdir('controller')
|
||||
|
||||
foreach pipeline : pipelines
|
||||
pipeline = pipeline.split('/')
|
||||
if pipeline.length() < 2 or pipeline[0] != 'rpi'
|
||||
continue
|
||||
endif
|
||||
|
||||
subdir(pipeline[1])
|
||||
endforeach
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue