Files
external_libcamera/include/libcamera/ipa/meson.build
Andrey Konovalov c987946e43 libcamera: ipa: Add Soft IPA
Define the Soft IPA main and event interfaces, add the Soft IPA
implementation.

The current src/ipa/meson.build assumes the IPA name to match the
pipeline name. For this reason "-Dipas=simple" is used for the
Soft IPA module.

Auto exposure/gain and AWB implementation by Dennis, Toon and Martti.

Auto exposure/gain targets a Mean Sample Value of 2.5 following
the MSV calculation algorithm from:
https://www.araa.asn.au/acra/acra2007/papers/paper84final.pdf

Use CameraSensorHelper to convert the analogue gain code read from the
camera sensor into real analogue gain value. In the future this makes
it possible to use faster AE/AGC algorithm. Right now the CameraSensorHelper
lets us use the full range of analogue gain values.

If there is no CameraSensorHelper for the camera sensor in use, a
warning log message is printed.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s
Tested-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Co-developed-by: Dennis Bonke <admin@dennisbonke.com>
Signed-off-by: Dennis Bonke <admin@dennisbonke.com>
Co-developed-by: Marttico <g.martti@gmail.com>
Signed-off-by: Marttico <g.martti@gmail.com>
Co-developed-by: Toon Langendam <t.langendam@gmail.com>
Signed-off-by: Toon Langendam <t.langendam@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-04-16 13:00:21 +01:00

168 lines
6.1 KiB
Meson

# SPDX-License-Identifier: CC0-1.0
libcamera_ipa_include_dir = libcamera_include_dir / 'ipa'
libcamera_ipa_headers = files([
'ipa_controls.h',
'ipa_interface.h',
'ipa_module_info.h',
])
install_headers(libcamera_ipa_headers,
subdir : libcamera_ipa_include_dir)
libcamera_generated_ipa_headers = []
ipa_headers_install_dir = get_option('includedir') / libcamera_ipa_include_dir
#
# Prepare IPA/IPC generation components
#
core_mojom_file = 'core.mojom'
ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module',
input : core_mojom_file,
output : core_mojom_file + '-module',
command : [
mojom_parser,
'--output-root', meson.project_build_root(),
'--input-root', meson.project_source_root(),
'--mojoms', '@INPUT@'
])
# core_ipa_interface.h
libcamera_generated_ipa_headers += custom_target('core_ipa_interface_h',
input : ipa_mojom_core,
output : 'core_ipa_interface.h',
depends : mojom_templates,
install : true,
install_dir : ipa_headers_install_dir,
command : [
mojom_generator, 'generate',
'-g', 'libcamera',
'--bytecode_path', mojom_templates_dir,
'--libcamera_generate_core_header',
'--libcamera_output_path=@OUTPUT@',
'./' +'@INPUT@'
])
# core_ipa_serializer.h
libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h',
input : ipa_mojom_core,
output : 'core_ipa_serializer.h',
depends : mojom_templates,
command : [
mojom_generator, 'generate',
'-g', 'libcamera',
'--bytecode_path', mojom_templates_dir,
'--libcamera_generate_core_serializer',
'--libcamera_output_path=@OUTPUT@',
'./' +'@INPUT@'
])
# Mapping from pipeline handler name to mojom file
pipeline_ipa_mojom_mapping = {
'ipu3': 'ipu3.mojom',
'rkisp1': 'rkisp1.mojom',
'rpi/vc4': 'raspberrypi.mojom',
'simple': 'soft.mojom',
'vimc': 'vimc.mojom',
}
#
# Generate headers from templates.
#
# TODO Define per-pipeline ControlInfoMap with yaml?
ipa_mojoms = []
mojoms_built = []
foreach pipeline, file : pipeline_ipa_mojom_mapping
name = file.split('.')[0]
# Avoid building duplicate mojom interfaces with the same interface file
if name in mojoms_built
continue
endif
if pipeline not in pipelines
continue
endif
mojoms_built += name
# {interface}.mojom-module
mojom = custom_target(name + '_mojom_module',
input : file,
output : file + '-module',
depends : ipa_mojom_core,
command : [
mojom_parser,
'--output-root', meson.project_build_root(),
'--input-root', meson.project_source_root(),
'--mojoms', '@INPUT@'
])
# {interface}_ipa_interface.h
header = custom_target(name + '_ipa_interface_h',
input : mojom,
output : name + '_ipa_interface.h',
depends : mojom_templates,
install : true,
install_dir : ipa_headers_install_dir,
command : [
mojom_generator, 'generate',
'-g', 'libcamera',
'--bytecode_path', mojom_templates_dir,
'--libcamera_generate_header',
'--libcamera_output_path=@OUTPUT@',
'./' +'@INPUT@'
])
# {interface}_ipa_serializer.h
serializer = custom_target(name + '_ipa_serializer_h',
input : mojom,
output : name + '_ipa_serializer.h',
depends : mojom_templates,
command : [
mojom_generator, 'generate',
'-g', 'libcamera',
'--bytecode_path', mojom_templates_dir,
'--libcamera_generate_serializer',
'--libcamera_output_path=@OUTPUT@',
'./' +'@INPUT@'
])
# {interface}_ipa_proxy.h
proxy_header = custom_target(name + '_proxy_h',
input : mojom,
output : name + '_ipa_proxy.h',
depends : mojom_templates,
command : [
mojom_generator, 'generate',
'-g', 'libcamera',
'--bytecode_path', mojom_templates_dir,
'--libcamera_generate_proxy_h',
'--libcamera_output_path=@OUTPUT@',
'./' +'@INPUT@'
])
ipa_mojoms += {
'name': name,
'mojom': mojom,
}
libcamera_generated_ipa_headers += [header, serializer, proxy_header]
endforeach
ipa_mojom_files = []
foreach pipeline, file : pipeline_ipa_mojom_mapping
if file not in ipa_mojom_files
ipa_mojom_files += file
endif
endforeach
ipa_mojom_files = files(ipa_mojom_files)
# Pass this to the documentation generator in src/libcamera/ipa
ipa_mojom_files += files(['core.mojom'])