summaryrefslogtreecommitdiff
path: root/utils
AgeCommit message (Collapse)Author
2024-02-27utils: checkstyle.py: Don't presume python3 locationMilan Zamazal
python3 binary may be present in a location other than /usr/bin/. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-02-15utils: mojom: Fix build error caused by the mojom tool updateNaushir Patuck
The update to the mojom tool in commit d17de86904f0 causes build errors with gcc 12.2 release builds. One such error is: In file included from src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:18: In static member function ‘static libcamera::ipa::RPi::ProcessParams libcamera::IPADataSerializer<libcamera::ipa::RPi::ProcessParams>::deserialize(std::vector<unsigned char>::const_iterator, std::vector<unsigned char>::const_iterator, libcamera::ControlSerializer*)’, inlined from ‘void IPAProxyRPiWorker::readyRead()’ at src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:302:70: include/libcamera/ipa/raspberrypi_ipa_serializer.h:1172:32: error: ‘*(uint32_t*)((char*)&ret + offsetof(libcamera::ipa::RPi::ProcessParams, libcamera::ipa::RPi::ProcessParams::buffers.libcamera::ipa::RPi::BufferIds::bayer))’ may be used uninitialized [-Werror=maybe-uninitialized] 1172 | return ret; The failure is caused by the new auto-generated IPA interface not initialising POD types to a default value. This is because the updated mojom library uses a new mojom.ValueKind class to represent POD types, whereas the interface generator script uses the mojom.Kind class, which is correct for the older mojom library. Fix this breakage by switching the interface generator script to use mojom.ValueKind to test for POD types. Fixes: d17de86904f0 ("utils: ipc: Update mojo") Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-25libcamera: signal: Replace object.h inclusion with forward declatationLaurent Pinchart
The signal.h header doesn't need to include object.h. Replace it with a forward declaration, and instead include object.h in source files that require it. It can speed up compilation a little bit, but more importantly avoids unintended dependencies from the Signal class to the Object class to be added later as the compiler will catch them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
2024-01-23utils: ipc: extract-docs: Fix escape characters in regexPaul Elder
Newer versions of python now generate a SyntaxWarning (SyntaxError in the future [1]) for invalid escape sequences. Fix this, as there were invalid escape sequences in the regexes: "libcamera/utils/ipc/./extract-docs.py:13: SyntaxWarning: invalid escape sequence '\/'" [1] https://docs.python.org/3.12/library/re.html Reported-by: Nicolas Dufresne <nicolas@ndufresne.ca> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-01-09utils: ipc: Update mojoLaurent Pinchart
Update mojo from commit 9be4263648d7d1a04bb78be75df53f56449a5e3a "Updating trunk VERSION from 6225.0 to 6226.0" from the Chromium repository. The update-mojo.sh script was used for this update. Bug: https://bugs.libcamera.org/show_bug.cgi?id=206 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: ipc: generate.py: Disable attributes checkerLaurent Pinchart
The attributes checker ensures that .mojom files don't contain unknown attributes. These check fail with the custom 'skipSerdes' and 'async' libcamera attributes. Ideally the list of supported attributes should be extended, but that can't easily be done without modifying the mojo sources that we try to keep identical to the upstream version to make updates easier. Disable the attributes checker completely for now to fix this issue. While at it, fix an indentation issue reported by checkstyle.py. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: ipc: generate.py: Add bindings directory to Python pathLaurent Pinchart
Newer mojo versions import a 'checks' module located in the bindings directory. In preparation for a mojo update, add the directory to the Python path make the import work. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: update-mojo.sh: Commit the mojo updateLaurent Pinchart
Commit the mojo update with a standardized commit message. As mojo is imported as-is without local modifications, this simplifies usage of the update script. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: update-mojo.sh: Reject a dirty libcamera treeLaurent Pinchart
If the libcamera tree is dirty committing the result of the mojo update will be messy. Bail out in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: update-mojo.sh: Change to the libcamera source directoryLaurent Pinchart
Instead of prefixing all paths to IPC files with ${ipc_dir}, change to the libcamera sources root directory and use relative file paths. This simplifies the update script. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: update-mojo.sh: Exit immediately on errorLaurent Pinchart
If an error occurs there's no point in ignoring it silently and continuing. Exit immediately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: update-mojo.sh: Properly remove old sourcesLaurent Pinchart
The update-mojo.sh script starts by removing all sources before copying the new files from chromium. A bug in the 'rm' command makes the removal a no-op: the glob pattern is quoted, which attempts to remove a file name '*' in the tools directory, not all files in the directory. Fix it by removing the whole utils/ipc/mojo/ directory. While at it, also remove the utils/ipc/tools/ directory that contains imported sources. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09hooks: pre-push: Disable interpretation of escape sequencesKieran Bingham
The pre-push hook validates the commit messages utilising 'echo' to send the captured data from the git commit through grep. Commit messages may occasionally contain strings that could appear to be escape sequences such as doxygen style references to \struct. The '\' 'c' escape sequence can be interpreted to supress all further output [0] which then breaks the processing and string matching. Unfortunatley for us, doxygen's class reference constructed in the same form as \struct can be interpreted as the escape sequence to supress further output. [0] https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins Update the pre-push hook to explicitly disable escape sequence interpretation using the '-E' flag. This is not available on the posix-compliant shell 'dash', so also switch to bash explicitly to prevent potential failures. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09utils: ipc: mojom_libcamera_generator.py: Fix Python warningMilan Zamazal
Python 3.12 starts emitting the following warning when building libcamera: .../utils/ipc/generators/mojom_libcamera_generator.py:372: SyntaxWarning: invalid escape sequence '\.' if not re.match('^ipa\.[0-9A-Za-z_]+', namespace): `r' prefix is now required before the regexp. Signed-off-by: Milan Zamazal <mzamazal@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>
2024-01-09utils: ipc: Fix deserialization of multiple fd parametersPaul Elder
The IPADataSerializer::deserializer attempts to optimise code paths and remove potentially unused code where multiple File Descriptors were not expected to be utilised. The addition of multiple SharedFD entries in the IPC highlights this as a bug. Clean up the conditionals to ensure that all File Descriptors are correctly deserialized. Bug: https://bugs.libcamera.org/show_bug.cgi?id=205 Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Tested-by: Andrey Konovalov <andrey.konovalov@linaro.org> 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>
2024-01-09utils: raspberrypi: ctt: Improve the Macbeth Chart search reliabilityDavid Plowman
Previously the code would brighten up images in case the Macbeth Chart is slightly dark, and also zoom in on sections of it to look for charts occupying less of the field of view. But it would not do both together. This change makes the search for smaller charts also repeat that search for the brightened up images that it made earlier, thereby increasing the chances of success for non-optimal tuning images. There are also a couple of very small drive-by typo fixes. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-11-30libcamera: controls: Use vendor tags for draft controls and propertiesNaushir Patuck
Label draft controls and properties through the "draft" vendor tag and deprecate the existing "draft: true" mechanism. This uses the new vendor tags mechanism to place draft controls in the same libcamera::controls::draft namespace and provide a defined control id range for these controls. This requires moving all draft controls from control_ids.yaml to control_ids_draft.yaml. One breaking change in this commit is that draft control ids also move to the libcamera::controls::draft namespace from the existing libcamera::controls namespace. This is desirable to avoid API breakages when adding new libcamera controls. So, for example, the use of controls::NOISE_REDUCTION_MODE will need to be replaced with controls::draft::NOISE_REDUCTION_MODE. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-11-29libcamera: control: Add vendor control id range reservationNaushir Patuck
Add a new control_ranges.yaml file that is used to reserve control id ranges/offsets for libcamera and vendor specific controls. This file is used by the gen-controls.py script to generate control id values for each control. Draft controls now have a separate range from core libcamera controls, breaking the existing numbering behaviour. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-11-29build: controls: Rework how controls and properties are generatedNaushir Patuck
Add support for using separate YAML files for controls and properties generation. The mapping of vendor/pipeline handler to control file is done through the controls_map variable in include/libcamera/meson.build. This simplifies management of vendor control definitions and avoids possible merge conflicts when changing the control_ids.yaml file for core and draft controls. With this change, libcamera and draft controls and properties files are designated the 'libcamera' vendor tag. In this change, we also rename control_ids.yaml -> control_ids_core.yaml and property_ids.yaml -> property_ids_core.yaml to designate these as core libcamera controls. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-11-29controls: Update argument handling for controls generation scriptsNaushir Patuck
The template file to the gen-controls.py and gen-py-controls.py is now passed in through the '-t' or '--template' command line argument instead of being a positional argument. This will allow multiple input files to be provided to the scripts in a future commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-11-29controls: Add vendor control/property support to generation scriptsNaushir Patuck
Add support for vendor-specific controls and properties to libcamera. The controls/properties are defined by a "vendor" tag in the YAML control description file, for example: vendor: rpi controls: - MyExampleControl: type: string description: | Test for libcamera vendor-specific controls. This will now generate a control id in the libcamera::controls::rpi namespace, ensuring no id conflict between different vendors, core or draft libcamera controls. Similarly, a ControlIdMap control is generated in the libcamera::controls::rpi namespace. A #define LIBCAMERA_HAS_RPI_VENDOR_CONTROLS is also generated to allow applications to conditionally compile code if the specific vendor controls are present. For the python bindings, the control is available with libcamera.controls.rpi.MyExampleControl. The above controls example applies similarly to properties. Existing libcamera controls defined in control_ids.yaml are given the "libcamera" vendor tag. A new --mode flag is added to gen-controls.py to specify the mode of operation, either 'controls' or 'properties' to allow the code generator to correctly set the #define string. As a drive-by, sort and redefine the output command line argument in gen-controls.py and gen-py-controls.py to ('--output', '-o') for consistency. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-10-18utils: update-kernel-headers: Support git worktreesLaurent Pinchart
When operating on a git worktree, the Linux kernel directory contains a .git file, not a .git directory. Relax the git tree check to support both. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-28utils: checkstyle.py: Extract title and trailers with one commandLaurent Pinchart
The Amendment class calls `git show` twice, once to extract the commit title, and a second time to extract the trailers. This can be combined in a single command, which is more efficient. Do so. While at it, centralize initialization of self._trailers in the Commit.__init__() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-28utils: raspberrypi: ctt: Code tidyingBen Benson
Altered the way that some lines are laid out, made functions more attractive to look at, and tidied up messy areas. Signed-off-by: Ben Benson <ben.benson@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2023-07-28utils: raspberrypi: ctt: Improved color matrix fittingBen Benson
Added code which optimises the color matrices based off delta E values for the calibration images. Working in LAB color space. Signed-off-by: Ben Benson <ben.benson@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2023-07-18utils: checkstyle.py: Check trailers for Amendment commitsKieran Bingham
The commit trailers are checked as part of processing the commit message with the newly introduced TrailersChecker. This relies on the trailers property being correctly exposed by the Commit object, and is implemented for the base Commit but not processed for Amendment commits. Refactor the trailer property handling to a helper function in the base Commit class and make use of it with a newly added call to obtain the existing Trailers from the most recent commit when using Amendment. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-18utils: checkstyle.py: Derive Amendment from CommitKieran Bingham
The Amendment commit class is derived from the StagedChanges class (which in turn derives from the Commit base class), however there is no code sharing between Amendment and StagedChanges other than the call to initalise through the base Commit class. Refactor the inheritance to make an Amendment derive directly from Commit. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-18utils: checkstyle.py: Initialise staged trailersKieran Bingham
There are no possible Trailers for staged changes as the commit message has not yet been written. Initialise the empty trailers when the commit object is initialised. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-18utils: checkstyle.py: Treat Malformed trailers as a CommitIssueKieran Bingham
If a Malformed trailer is identified the checkstyle script triggers a RuntimeError and stops processing the rest of the commit. A malformed trailer can be regarded as an issue in the commit and reported as such using the same method as other faults identified by the tool. Convert the RuntimeError into a CommitIssue and continue processing other trailers. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05utils: checkstyle: Add trailers checkerLaurent Pinchart
The libcamera git history contains numerous examples of incorrect commit message trailers due to invalid trailer types (e.g. Change-Id), typos and other small issues. Those went unnoticed through reviews, which shows that an automated checker is required. Add a trailers checker to checkstyle.py to catch invalid or malformed trailers, with a set of supported trailers that match libcamera's commit message practices. New trailer keys can easily be added later as new needs arise. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05utils: checkstyle: Don't include commit ID in commit titleLaurent Pinchart
The commit title and commit ID are two different pieces of information. Don't include the latter in the former, to simplify code that only needs the commit title. Constructing a string from the ID and title is easier than splitting the combined string back into its elements. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-05utils: checkstyle: Support running checkers selectivelyLaurent Pinchart
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-05utils: checkstyle: Add __repr__ method to CommitFile classLaurent Pinchart
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-05utils: ipu3-capture.sh: Fix the script to work with recent media-ctl versionsHans de Goede
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-04utils: ABI Compatibility checkerKieran Bingham
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-04-05utils: ipc: Update parser.pyHarvey Yang
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-05meson: Really fix git version parsingLaurent Pinchart
The previous attempt to fix git version parsing in commit d34cefad1791 ("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: d34cefad1791 ("meson: Fix git version parsing") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-03-01utils: checkstyle.py: Don't run commit title checker on staged commitsPaul Elder
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-01-10utils: checkstyle.py: Add commit title checkerLaurent Pinchart
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>
2022-12-15utils: checkstyle.py: Check new header file on new and renamed meson.build filesXavier Roumegue
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-11-25utils: tuning: Add tuning script for rkisp1Paul Elder
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-25utils: tuning: Add alsc-only libtuning raspberrypi tuning scriptPaul Elder
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-25utils: libtuning: generators: Add yaml outputPaul Elder
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-25utils: libtuning: parsers: Add yaml parserPaul Elder
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-25utils: libtuning: generators: Add raspberrypi outputPaul Elder
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-25utils: libtuning: parsers: Add raspberrypi parserPaul Elder
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-25utils: libtuning: modules: alsc: Add rkisp1 LSC modulePaul Elder
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-25utils: libtuning: modules: alsc: Add raspberrypi ALSC modulePaul Elder
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-25utils: libtuning: modules: Add base LSC modulePaul Elder
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-25utils: tuning: libtuning: Implement extensible components of libtuningPaul Elder
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>