Skip to content

Commit

Permalink
pipeline: rpi: Add support for Raspberry Pi 5
Browse files Browse the repository at this point in the history
Add the Raspberry Pi 5 ISP (PiSP) pipeline handler to libcamera. To
include this pipeline handler in the build, set the following meson
option:

meson configure -Dpipelines=rpi/pisp

Signed-off-by: Naushir Patuck <[email protected]>
Reviewed-by: David Plowman <[email protected]>
  • Loading branch information
naushir committed Nov 4, 2024
1 parent e7e86c1 commit 4c1dce9
Show file tree
Hide file tree
Showing 10 changed files with 2,379 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/guides/pipeline-handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ to the libcamera build options in the top level ``meson_options.txt``.
option('pipelines',
type : 'array',
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
choices : ['ipu3', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
description : 'Select which pipeline handlers to include')
Expand Down
1 change: 1 addition & 0 deletions include/libcamera/ipa/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ libcamera_ipa_headers += custom_target('core_ipa_serializer_h',
pipeline_ipa_mojom_mapping = {
'ipu3': 'ipu3.mojom',
'rkisp1': 'rkisp1.mojom',
'rpi/pisp': 'raspberrypi.mojom',
'rpi/vc4': 'raspberrypi.mojom',
'simple': 'soft.mojom',
'vimc': 'vimc.mojom',
Expand Down
1 change: 1 addition & 0 deletions include/libcamera/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ controls_map = {
'controls': {
'draft': 'control_ids_draft.yaml',
'core': 'control_ids_core.yaml',
'rpi/pisp': 'control_ids_rpi.yaml',
'rpi/vc4': 'control_ids_rpi.yaml',
},

Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ pipelines_support = {
'ipu3': arch_x86,
'mali-c55': arch_arm,
'rkisp1': arch_arm,
'rpi/pisp': arch_arm,
'rpi/vc4': arch_arm,
'simple': ['any'],
'uvcvideo': ['any'],
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ option('pipelines',
'ipu3',
'mali-c55',
'rkisp1',
'rpi/pisp',
'rpi/vc4',
'simple',
'uvcvideo',
Expand Down
5 changes: 5 additions & 0 deletions src/libcamera/pipeline/rpi/common/rpi_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class Stream : public libcamera::Stream
* to be applied after ISP processing.
*/
Needs32bitConv = (1 << 4),
/*
* Indicates that the input stream needs a software 16-bit endian
* conversion to be applied before ISP processing.
*/
Needs16bitEndianSwap = (1 << 5),
};

using StreamFlags = Flags<StreamFlag>;
Expand Down
45 changes: 45 additions & 0 deletions src/libcamera/pipeline/rpi/pisp/data/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": 1.0,
"target": "pisp",

"pipeline_handler":
{
# Number of CFE config and stats buffers to allocate and use. A
# larger number minimises the possibility of dropping frames,
# but increases the latency for updating the HW configuration.
#
# "num_cfe_config_stats_buffers": 12,

# Number of jobs to queue ahead to the CFE on startup. A larger
# number will increase latency for 3A changes, but may reduce
# avoidable frame drops.
#
# "num_cfe_config_queue": 2,

# Override any request from the IPA to drop a number of startup
# frames.
#
# "disable_startup_frame_drops": false,

# Custom timeout value (in ms) for camera to use. This overrides
# the value computed by the pipeline handler based on frame
# durations.
#
# Set this value to 0 to use the pipeline handler computed
# timeout value.
#
# "camera_timeout_value_ms": 0,

# Disables temporal denoise functionality in the ISP pipeline.
# Disabling temporal denoise avoids allocating 2 additional
# Bayer framebuffers required for its operation.
#
# "disable_tdn": false,

# Disables multiframe HDR functionality in the ISP pipeline.
# Disabling multiframe HDR avoids allocating 2 additional Bayer
# framebuffers required for its operation.
#
# "disable_hdr": false,
}
}
8 changes: 8 additions & 0 deletions src/libcamera/pipeline/rpi/pisp/data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: CC0-1.0

conf_files = files([
'example.yaml',
])

install_data(conf_files,
install_dir : pipeline_data_dir / 'rpi' / 'pisp')
12 changes: 12 additions & 0 deletions src/libcamera/pipeline/rpi/pisp/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: CC0-1.0

libcamera_internal_sources += files([
'pisp.cpp',
])

librt = cc.find_library('rt', required : true)
libpisp_dep = dependency('libpisp', fallback : ['libpisp', 'libpisp_dep'])

libcamera_deps += [libpisp_dep, librt]

subdir('data')
Loading

0 comments on commit 4c1dce9

Please sign in to comment.