Commit graph

199 commits

Author SHA1 Message Date
Laurent Pinchart
69e3983acf utils: checkstyle: Support running checkers selectively
During development of the checkstyle.py script, it can be useful to run
only a subset of the checker. Add the ability to do so with a
'--checkers' command line argument.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05 15:39:00 +03:00
Laurent Pinchart
c9b2f62edd utils: checkstyle: Add __repr__ method to CommitFile class
Add a custom representation to the CommitFile class in order to
facilitate debugging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05 15:39:00 +03:00
Hans de Goede
c49958d0b4 utils: ipu3-capture.sh: Fix the script to work with recent media-ctl versions
Recent media-ctl versions include the framerate in the fmt property output:

- entity 37: ov5693 4-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev6
	pad0: Source
		[fmt:SBGGR10_1X10/2592x1944@1/30
		 crop.bounds:(16,6)/2592x1944
		 crop:(16,6)/2592x1944]
		-> "ipu3-csi2 1":0 [ENABLED]

This resulted in $sensor_size getting set to: "2592x1944@1 30", which
causes the script to fail.

Fix this by:

1. Replacing the gsub() to remove the '/' between e.g. SBGGR10_1X10
and 2592x1944 with a sub() so that only that first '/' gets replaced
(resulting in a $sensor_size of "2592x1944@1/30" instead).

2. Adding a new sub() to remove the @1/30 suffix.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05 00:51:34 +01:00
Kieran Bingham
bbb77cc59b utils: ABI Compatibility checker
Provide support to compare ABI compatibility between any two git commits
or by a commit and the most recent ancestral tag of that commit.

Tested-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-04 20:25:10 +01:00
Harvey Yang
c1cc37b2ee utils: ipc: Update parser.py
Make the local mojom library the first priority in the sys path, to
avoid mixing the local one with the system one in build.

Tested on chromebook soraka-libcamera.

Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-04-05 08:24:11 +03:00
Laurent Pinchart
4cd9cb4a90 meson: Really fix git version parsing
The previous attempt to fix git version parsing in commit d34cefad17
("meson: Fix git version parsing") was too naive, and didn't take into
account cases where the libcamera git version contains no or multiple
'+' signs.

Fixing this is more complex than a one-liner change, as meson doesn't
support Python-style slicing of arrays or a length method on strings.
The simplest and most versatile option is to patch the version string in
the gen-version.sh script. Do so, and clarify the comments related to
version handling in meson.build.

Fixes: d34cefad17 ("meson: Fix git version parsing")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-04-05 07:16:07 +03:00
Paul Elder
51396ab512 utils: checkstyle.py: Don't run commit title checker on staged commits
When creating a new commit, there is no title, so the title checker
complains that the title isn't compliant and the commit cannot be
created if checkstyle is run as a pre-commit hook. Fix this by skipping
the title checker when run on staged changes.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-03-01 17:20:05 +09:00
Laurent Pinchart
2535e31d9e utils: checkstyle.py: Add commit title checker
Add a commit checker to ensure that commit titles start with a prefix.
The commit issue message lists prefix candidates retrieved from the git
log.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-01-10 15:36:13 +02:00
Xavier Roumegue
7ace78e215 utils: checkstyle.py: Check new header file on new and renamed meson.build files
Declaration of new header file to the build system are only checked against
modified meson.build file. Therefore, this raises a false positive warning in
case the meson.build is added or renamed.

Add the new and renamed meson.build files to the list of files to check header
file inclusion.

Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-12-15 12:31:48 +02:00
Paul Elder
c7bbe0ca3a utils: tuning: Add tuning script for rkisp1
Add a tuning script for rkisp1 that uses libtuning. So far it only
supports LSC.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:38:17 +09:00
Paul Elder
4af9f81802 utils: tuning: Add alsc-only libtuning raspberrypi tuning script
Add a tuning script for raspberrypi for alsc only, that uses libtuning.
Since there will also be a tuning script for raspberrypi that has more
modules, put the libtuning alsc module definition in a separate file so
that it can be reused later.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:38:13 +09:00
Paul Elder
d62f2acce4 utils: libtuning: generators: Add yaml output
Add a generator to libtuning for writing tuning output to a yaml file.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:38:03 +09:00
Paul Elder
0f89bf3efd utils: libtuning: parsers: Add yaml parser
Add a parser to libtuning for parsing configuration files in yaml
format.

At the moment it doesn't parse anything and simply returns an empty
config. This is fine for the time being, as the only user of it is the
rkisp1 tuning script, which only has an LSC module which doesn't consume
anything from the configuration file. When a module comes around that
requires the yaml parser, it can be implemented then.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:50 +09:00
Paul Elder
b44ee5c348 utils: libtuning: generators: Add raspberrypi output
Add a generator to libtuning for writing tuning output to a json file
formatted the same way that raspberrypi's ctt formats them.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:47 +09:00
Paul Elder
49dfb9ae43 utils: libtuning: parsers: Add raspberrypi parser
Add a parser to libtuning for parsing configuration files that are the
same format as raspberrypi's ctt's configuration files.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:44 +09:00
Paul Elder
f715a75843 utils: libtuning: modules: alsc: Add rkisp1 LSC module
Add an LSC module for RkISP1.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:41 +09:00
Paul Elder
280e4acf94 utils: libtuning: modules: alsc: Add raspberrypi ALSC module
Add an ALSC module for Raspberry Pi.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:38 +09:00
Paul Elder
288cfb9b8b utils: libtuning: modules: Add base LSC module
Add a base LSC module to libtuning's collection of modules. It is based
on raspberrypi's ctt's ALSC, but customizable for different lens shading
table sizes, among other things. It alone is insufficient as a module,
but it provides utilities that are useful for and which will simplify
implementing LSC modules.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:34 +09:00
Paul Elder
b8af2500fa utils: tuning: libtuning: Implement extensible components of libtuning
Implement the extensible components of libtuning. This includes:
- Parsers, for supporting different types of input config file formats
- Generators, for supporting different types of output tuning file
  formats
- Modules, for supporting different tuning modules for different
  algorithms and platforms

No parsers, generators, or modules are actually implemented. Only the
base classes are implemented.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:30 +09:00
Paul Elder
db99d96663 utils: tuning: libtuning: Implement math helpers
Implement math helpers for libtuning. This includes:
- Average, a wrapper class for numpy averaging functions
- Gradient, a class that represents gradients, for distributing and
  mapping
- Smoothing, a wrapper class for cv2 smoothing functions

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:26 +09:00
Paul Elder
19dc8c28f6 utils: tuning: libtuning: Implement the core of libtuning
Implement the core of libtuning, our new tuning tool infrastructure. It
leverages components from raspberrypi's ctt that could be reused for
tuning tools for other platforms.

The core components include:
- The Image class
- libtuning (entry point and other core functions)
- macbeth-related tools, including the macbeth reference image
- utils

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-25 15:37:22 +09:00
Barnabás Pőcze
cfa7488072 libcamera: tracing: fix header generation when built as subproject
Building libcamera as a subproject is failing when tracepoints are
enabled due to incorrectly managing the relative paths between the
source and build directory while generating tracepoint headers.

The previously used

  path = output.replace('include/', '', 1)

logic is not sufficient to correctly determine the proper path when
libcamera is built as a subproject, and does not correctly handle the
relative paths, causing path to be processed as:

  'subprojects/libcamera/include/libcamera/internal/tracepoints.h'.replace('include/', '', 1)

which evaluates to

  'subprojects/libcamera/libcamera/internal/tracepoints.h'

so the tracepoints.h header file will try to include:

  #define TRACEPOINT_INCLUDE "subprojects/libcamera/libcamera/internal/tracepoints.h"

which will fail.

Fix it by using Python's pathlib to calculate the relative path of the
output file with respect to the "include" directory of libcamera.

This has been tested with Pipewire. For non-subproject builds it should
generate the exact same path that was previously generated.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
[Kieran: Commit message expanded/reworded]
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-24 14:52:00 +00:00
Paul Elder
c8e6b114f0 utils: raspberrypi: ctt: Fix alsc green averaging
The alsc component of ctt meant to average the two green channels into
one, but used incorrect indexing resulting in only the first green
channel being used. Fix this.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2022-10-20 11:40:29 +09:00
Paul Elder
4e9ed14311 utils: ipc: Allow the skipHeader attribute on enums
Currently, enums that are passed between pipeline handlers and their IPA
must be defined in a mojom file. However, there is a use case for
enum/flags to be defined in a C++ header, such that the enum can be used
in a component other than the pipeline handler and its IPA.

To support this, add support for the skipHeader attribute for enums.
Like structs, it is only allowed in core.mojom.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18 18:52:52 +09:00
Paul Elder
207c9e1c1d utils: ipc: Add support for Flags
Add Flags<E> as a supported type in the IPA interface.

It is used in mojom with the [flags] attribute. Any field or parameter
type E that is prefixed with the [flags] attribute will direct the code
generator to generate the type name "Flags<E>" and appropriate
serialization/deserialization code for Flags<E> instead of for E.

It is usable and has been tested in struct members, function input and
output parameters, and Signal parameters. This does not add support for
returning Flags as direct return values.

Additionally, the [scopedEnum] attribute can be used on enum
definitions, which will instruct the code generator to convert it to an
enum class instead of a raw enum.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-18 18:51:33 +09:00
Paul Elder
3f9da2a71e utils: ipc: Add support for enums in function parameters
There is already support for enums as struct members, but there was no
support for enums in function parameters. Add it.

This does not add support for returning enums as direct return values.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-18 18:51:21 +09:00
Kieran Bingham
fc46d09123 utils: Provide a release script
Support making releases of libcamera by introducing a helper script
which will facilitate the increment of any release version, along with
generating an associated tag.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-13 12:40:24 +01:00
Kieran Bingham
1bd14fc895 utils: semver: Add version helper
Provide the semver utility (version 3.4.0) from [0] to make use of it
with our versioning and release scripts.

[0] https://raw.githubusercontent.com/fsaintjacques/semver-tool/3c76a6f9d113f4045f693845131185611a62162e/src/semver

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-13 12:40:23 +01:00
Laurent Pinchart
22ab0b4193 utils: gen-controls: Improve YAML notation for variable-size array controls
Array controls specify the array size through the YAML 'size' element,
which stores a list of values, one per dimension. Variable-size arrays
currently use an empty 'size' list, which prevents describing the number
of dimensions of the array.

Improve this by using the same notation for fixed-size and variable-size
array controls. Dimensions that are not fixed are described as a string
instead of an integer, such as [n], [n,3] or [w,h]. The strings have
currently no special meaning, this may change in the future.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-10-07 18:28:05 +03:00
Laurent Pinchart
24f866f6a3 utils: gen-controls: Factor out YAML data handling in classes
The gen-controls.py script handles the data structure produced by the
YAML parser manually through the whole code base. Clean this up by
encapsulating it in Control and ControlEnum classes to model a control
and its enum values respectively, to decouple YAML data handling from
generation.

No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-10-07 18:27:31 +03:00
Laurent Pinchart
daec83536d utils: rkisp1: gen-csc-table: Add support for inverting the CSC
Add a -i/--invert command line argument to invert the YCbCr encoding and
output a YCbCr to RGB matrix.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-09-30 22:30:17 +03:00
Laurent Pinchart
3440740ff3 utils: raspberrypi: Add missing SPDX header to delayedctrls_parse.py
The delayedctrls_parse.py script is missing license information. Add an
SPDX header to fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-09-30 21:51:20 +03:00
Laurent Pinchart
4baaecb4ff utils: rkisp1: gen-csc-table: Specify coefficients with full precision
The Rec01, Rec709, Rec2020 and SMTPE 240M standards specify the Cb and
Cr coefficients of the RGB to Y'CbCr conversion matrix using a quotient
of two values. Use the exact same formulas instead of hardcoding the
division results with a lower precision.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Florian Sylvestre <fsylvestre@baylibre.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-08-30 15:25:35 +03:00
Laurent Pinchart
3fad116f89 utils: rkisp1: Add script to generate CSC coefficients
This script generates fixed-point integer coefficients for the YCbCr
encoding 3x3 matrix. The encoding, quantization and fixed-point
precision can be selected through command line arguments.

The main purpose of the script is to generate coefficient tables to
extend the rkisp1 driver with support for additional YCbCr encodings,
but it may be useful for other purposes as well given that the rounding
isn't trivial.

The Rec. 601 full and limited range coefficients have been verified to
match the values currently used by the rkisp1 driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-08-26 15:42:09 +03:00
Christian Rauch
09c1b081ba libcamera: controls: Generate and use fixed-sized Span types
Define Span types explicitly as either variable- or fixed-sized. This
introduces a new convention for defining Span dimensions in the property
and control value definitions and generates Span types as variable-sized
Span<T> or as fixed-sized Span<T,N>.

Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-08-09 13:53:29 +03:00
William Vinnicombe
23b6965a93 utils: raspberrypi: ctt: dng_load_image: Work with DNG files from Picamera2
The DNG specification is based on the TIFF file format and recommends
storing the raw image data in a SubIFD and the Exif tags in an Exif IFD.
Other options are allowed, even if not recommended, such as storing both
the raw image data and the Exif data in IFD0, as done by the TIFF/EP
specification.

libcamera-apps use pyexiv2 to produce DNG files, following the DNG
recommendation, while applications based on picamera2 use PiDNG, which
adopts the TIFF/EP structure. Why it does so is not currently clear (see
https://github.com/schoolpost/PiDNG/issues/65 for discussions on this
topic), but as files based on the DNG and TIFF/EP variants exist in the
wild, both need to be supported by ctt.

Add code to identify which tags are being used, and then load the
metadata from the correct tags.

Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-08-03 14:32:19 +03:00
William Vinnicombe
79b4c1c51e utils: raspberrypi: ctt: Add alsc_only method
The ctt would not work if only passed alsc images.

Add alsc_only.py to run alsc calibration only, and modify check_imgs
to allow for no macbeth chart images.

Example usage would be ./alsc_only.py -i tuning-images/ -o sensor.json
with the same optional arguments as the original ctt.

Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-08-02 16:59:06 +03:00
Naushir Patuck
20bdc7ee88 utils: raspberrypi: Add tuning file conversion script
Add a script to convert the Raspberry Pi camera tuning file format from version
1.0 to 2.0. This script also adds a root level version key set to 2.0 to the
config file, allowing the controller to distinguish between the two formats.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28 13:48:51 +03:00
Naushir Patuck
73c1a1d697 utils: raspberrypi: ctt: Output version 2.0 format tuning files
Update the ctt_pretty_print_json.py script to generate the new version 2.0
format camera tuning file. This script can be called through the command line
to prettify an existing JSON file, or programatically by the CTT to format a
new JSON config dictionary.

Update the CTT to produce a version 2.0 format json structure and use
ctt_pretty_print_json.pretty_print to prettify the output.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28 13:47:51 +03:00
Naushir Patuck
f95bae418c raspberrypi: Update Copyright statement in all Raspberry Pi source files
s/Raspberry Pi (Trading) Limited/Raspberry Pi Ltd/ to reflect the new
Raspberry Pi entity name.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27 18:12:15 +03:00
Umang Jain
9eb8211160 utils: ipu3-pack: Provide a 10-bit bayer packing utility
Provide a 10-bit bayer packing utility for the unpacked data produced
by ipu3-unpack.

	Usage: ipu3-unpack input-file output-file

The output-file can be "-" to pack the data to stdout.

The output file generated by ipu3-pack can be directly fed to IMGU
for streaming.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-19 21:43:35 +05:30
Laurent Pinchart
a5877e0307 utils: rkisp1: Support optional CSI-2 receiver subdev
The media graph may include a CSI-2 receiver entity between the sensor
and the ISP for platforms that have a CSI-2 receiver external to the
ISP. Support this by configuring the pipeline accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-07-15 13:46:22 +03:00
Laurent Pinchart
4d3a118c11 utils: rkisp1: Fix pixel format for raw capture
The regexp to convert the raw pixel media bus code to a pixel format is
incorrect. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-07-15 13:46:18 +03:00
Laurent Pinchart
9007d37939 utils: rkisp1: Fix sensor format parsing
With sensors supporting crop, the regexp used to parse the media-ctl
output isn't correct as the pad configuration may span multiple lines
and contain other parameters. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-07-15 13:46:15 +03:00
Laurent Pinchart
695304c43f utils: rkisp1: Remove frames before starting capture
Delete frames previously captured before starting a new capture, to
avoid mixing old and new frames.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-07-15 13:45:58 +03:00
Umang Jain
3e15e8c6c3 utils: ipu3-unpack: Fix error string
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-13 17:38:49 +05:30
William Vinnicombe
ed12bb4aba utils: raspberrypi: ctt: load_image: Ignore JPEG files with no raw data
The load_image function would throw errors with JPEG or JPG files containing
no raw data.

Prevent throwing these errors by returning 0 if an error has occurred.

Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-06 21:33:35 +03:00
Tomi Valkeinen
b4bb5ce629 utils: checkstyle.py: Fix color bleed
If issue.line is None, the the terminal color is never reset back to
normal. This causes the yellow color to bleed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-03 23:35:22 +03:00
Laurent Pinchart
7a529a9e35 utils: checkstyle: Ensure "..." include style for internal headers
libcamera uses the "..." include style for internal headers. Enforce it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-01 12:08:34 +03:00
Laurent Pinchart
c58ac2f498 utils: checkstyle: Run the CLangFormatter last
The IncludeOrderFormatter will be extended with more formatting rules
that should be applied before clang-format gets run, as it will
influence its output.

Add a priority mechanism for formatters, and give a negative priority to
the CLangFormatter to make it run last.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-01 12:08:29 +03:00