Commit graph

58 commits

Author SHA1 Message Date
David Plowman
6960684fa1 utils: raspberrypi: ctt: Add a maximum gain parameter for LSC
A max_gain parameter is added to the config file which we pass to the
lens shading calibration. This clamps the maximum luminance gain that
gets written into the tuning files so as to prevent overflows.

It is particularly useful for lenses that cut off the light completely
from the sensor corners, and allows usable tables to be generated for
them.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 11:02:39 +01:00
Naushir Patuck
b40d9dbc0b utils: raspberrypi: ctt: Add option to convert between vc4/pisp targets
This change adds functionality to the convert_tuning.py script to
convert between vc4 and pisp target tuning files. The conversion is
done on a best effort basis, and should provide functional tuning files.
However, a full tuning for the target platform is always preferred.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 11:02:39 +01:00
David Plowman
e7d628942f utils: raspberrypi: ctt: Update tuning tool for HDR
The various boilerplate parts of the tuning file are extended to
include the necessary extra bits for HDR, specifically:

* rpi.denoise has different configurations for HDR modes
* rpi.agc now has extra channels for HDR
* rpi.hdr parameters are added.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 11:02:38 +01:00
Ben Benson
b95032a842 utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP
Changed how users select which platform to tune for. Now users
specify a command line argument, '-t', to specify which target
platform.

Signed-off-by: Ben Benson <ben.benson@raspberrypi.com>
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 11:02:26 +01:00
Ben Benson
8bea2d5a8a utils: raspberrypi: ctt: Added CAC support to the CTT
Added the ability to tune the chromatic aberration correction
within the ctt. There are options for cac_only or to tune as part
of a larger tuning process. CTT will now recognise any files that
begin with "cac" as being chromatic aberration tuning files.

Signed-off-by: Ben Benson <ben.benson@raspberrypi.com>
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 11:02:16 +01:00
David Plowman
d13542c28f utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP
The old ctt.py and alsc_only.py scripts are removed.

Instead of ctt.py use ctt_vc4.py or ctt_pisp.py, depending on your
target platform.

Instead of alsc_only.py use alsc_vc4.py or alsc_pisp.py, again
according to your platform.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-13 10:13:33 +01:00
Laurent Pinchart
626172a16b libcamera: Drop file name from header comment blocks
Source files in libcamera start by a comment block header, which
includes the file name and a one-line description of the file contents.
While the latter is useful to get a quick overview of the file contents
at a glance, the former is mostly a source of inconvenience. The name in
the comments can easily get out of sync with the file name when files
are renamed, and copy & paste during development have often lead to
incorrect names being used to start with.

Readers of the source code are expected to know which file they're
looking it. Drop the file name from the header comment block.

The change was generated with the following script:

----------------------------------------

dirs="include/libcamera src test utils"

declare -rA patterns=(
	['c']=' \* '
	['cpp']=' \* '
	['h']=' \* '
	['py']='# '
	['sh']='# '
)

for ext in ${!patterns[@]} ; do
	files=$(for dir in $dirs ; do find $dir -name "*.${ext}" ; done)
	pattern=${patterns[${ext}]}

	for file in $files ; do
		name=$(basename ${file})
		sed -i "s/^\(${pattern}\)${name} - /\1/" "$file"
	done
done
----------------------------------------

This misses several files that are out of sync with the comment block
header. Those will be addressed separately and manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-05-08 22:39:50 +03:00
Umang Jain
503c3a838a libcamera: Fix output spelling error
There are two places where "output" is spelled as "ouput".
Fix it.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.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-04-20 01:18:07 +01:00
David Plowman
66479605ba utils: raspberrypi: ctt: Improve the Macbeth Chart search reliability
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>
2024-01-09 15:39:02 +00:00
Ben Benson
09dd65442b utils: raspberrypi: ctt: Code tidying
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-28 08:32:40 +01:00
Ben Benson
f8dd17a8f4 utils: raspberrypi: ctt: Improved color matrix fitting
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-28 08:31:38 +01: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
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
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
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
David Plowman
a792512496 utils: raspberrypi: ctt: Fix namespace for sklearn NearestCentroid function
Starting in version 0.22, the NearestCentroid function is only available
in the sklearn.neighbors namespace, when it was previously available in
both the sklearn.neighbors.nearest_centroid and sklearn.neighbors
namespaces. Use sklearn.neighbors as it works on all versions of
sklearn.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.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>
2021-08-03 10:54:26 +03:00
David Plowman
2d99cc53e2 utils: raspberrypi: ctt: Fix usage of findHomography function
The OpenCV findHomography function now raises an unhandled error if it
receives fewer than 4 points whereas previously the limit was 3. This
makes no material difference to the behaviour of the tuning tool as it
will continue to search for the Macbeth chart at different scales.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.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>
2021-08-02 03:43:53 +03:00
Naushir Patuck
e363eb0b6b utils: raspberrypi: Add a DelayedControls log parser
This script will parse log output from the DelayedControls helper, when
enabled with:

LIBCAMERA_LOG_LEVELS=DelayedControls:0

It tabulates all control queuing/writing/getting per frame and warns
about potential issues related to frame delays not being account for, or
writes that are lagging behind or missed.

Run with the following command:

python3 ./delayedctrls_parse.py <logfile>

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Acked-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
[Kieran: Fix python raw strings]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-12 14:12:55 +00:00
David Plowman
6669051825 src: ipa: raspberrypi: Change 'sport' exposure mode name to 'short'
The names have to match for the setting to work. Use the libcamera
terminology for consistency (even though it touches more files).

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-11-20 11:31:56 +00:00
Laurent Pinchart
a83d6ac901 utils: raspberrypi: ctt: json_pretty_print: Add newline at end of output
Make sure the output ends with a newline.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:56 +03:00
Laurent Pinchart
f128acc325 utils: raspberrypi: ctt: json_pretty_print: Avoid spaces at end of lines
Avoid outputting spaces at end of lines by recording the need for a
space and outputting it before the next character only if not a newline.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:54 +03:00
Laurent Pinchart
bfad33c3ef utils: raspberrypi: ctt: json_pretty_print: Collapse newlines
Simplify the newline skipping logic by simply collapsing newlines. If a
newline has been output, all subsequent newlines will be skipped until
the next non-newline character is output.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:50 +03:00
Laurent Pinchart
d9617a499a utils: raspberrypi: ctt: json_pretty_print: Fix indentation handling
Indentation is handled by outputting spaces right after outputting a
newline character. That works in most cases, but would result in the
input '{}' being printed as

{
    }

instead of

{
}

Fix it by outputting the indentation before outputting the next
character after a newline. The indentation value will be updated by
then.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:47 +03:00
Laurent Pinchart
606741deb9 utils: raspberrypi: ctt: json_pretty_print: Add character write method
Add a write method to the JSONPrettyPrinter class to output a character.
This will be used to handle state updates when outputting individual
characters.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:45 +03:00
Laurent Pinchart
e101c78e03 utils: raspberrypi: ctt: json_pretty_print: Skip all spaces
Skip all white space characters, not just ' '. This makes a difference
if the input JSON data is already formatted.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:42 +03:00
Laurent Pinchart
5224f471ca utils: raspberrypi: ctt: json_pretty_print: Make test output to stdout
The standalone test mode output to a file name "pretty.json". To make
the test mode more versatile, output to stdout instead. The user can
then decide how to use the output.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:40 +03:00
Laurent Pinchart
4321f6e96e utils: raspberrypi: ctt: json_pretty_print: Make output file a class member
Instead of passing the output file to every method of the printer class,
make it a class member.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:38 +03:00
Laurent Pinchart
926fe94e4c utils: raspberrypi: ctt: json_pretty_print: Turn printer into a class
Instead of passing a state dictionary to every method, turn the printer
into a class and store the state internally.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:32 +03:00
Laurent Pinchart
1a5b168592 utils: raspberrypi: ctt: json_pretty_print: Fix printer test
The ctt_pretty_print_json.py file supports being run standalone to test
the code. It however suffers from multiple issues:

- The same input file name is hardcoded, and doesn't exist in the
  repository
- The input file name is used instead of JSON data

Fix both issues and make the input file selectable on the command line.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
2020-07-03 18:15:19 +03:00
Laurent Pinchart
e7aa92a883 utils: raspberrypi: ctt: Fix pycodestyle W605
W605 invalid escape sequence '\.'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-06-29 17:38:18 +03:00
Laurent Pinchart
e8655c2161 utils: raspberrypi: ctt: Fix pycodestyle E302
E302 expected 2 blank lines, found 0

Note that issues are still flagged, due to the use of docstrings as
multi-lines comments. This will be addressed separately.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 17:00:25 +03:00
Laurent Pinchart
33c4221e87 utils: raspberrypi: ctt: Fix pycodestyle E305
E305 expected 2 blank lines after class or function definition

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 17:00:13 +03:00
Laurent Pinchart
2b21c6ac86 utils: raspberrypi: ctt: Fix pycodestyle E741
E741 ambiguous variable name 'l'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 17:00:07 +03:00
Laurent Pinchart
4939e114b6 utils: raspberrypi: ctt: Fix pycodestyle W504
W504 line break after binary operator

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 17:00:04 +03:00
Laurent Pinchart
57e999a4ae utils: raspberrypi: ctt: Fix pycodestyle E722
E722 do not use bare 'except'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 17:00:01 +03:00
Laurent Pinchart
5eae909293 utils: raspberrypi: ctt: Fix pycodestyle E721
E721 do not compare types, use 'isinstance()'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:58 +03:00
Laurent Pinchart
f8e9810020 utils: raspberrypi: ctt: Fix pycodestyle E713
E713 test for membership should be 'not in'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:55 +03:00
Laurent Pinchart
a49fd8ea1d utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
E116 unexpected indentation (comment)
E117 over-indented (comment)

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:51 +03:00
Laurent Pinchart
67f9605a7f utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
E123 closing bracket does not match indentation of opening bracket's line
E126 continuation line over-indented for hanging indent

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:47 +03:00
Laurent Pinchart
ca73168e75 utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
E711 comparison to None should be 'if cond is None:'
E711 comparison to None should be 'if cond is not None:'
E712 comparison to False should be 'if cond is False:' or 'if not cond:'
E712 comparison to True should be 'if cond is True:' or 'if cond:'

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:07 +03:00
Laurent Pinchart
5f2160cc96 utils: raspberrypi: ctt: Fix pycodestyle E222
E222 multiple spaces after operator

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:59:01 +03:00
Laurent Pinchart
23cb30918c utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
E261 at least two spaces before inline comment
E262 inline comment should start with '# '

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:58:58 +03:00
Laurent Pinchart
23db936a1f utils: raspberrypi: ctt: Fix pycodestyle E303
E303 too many blank lines

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:58:54 +03:00
Laurent Pinchart
e31b104fd1 utils: raspberrypi: ctt: Fix pycodestyle E701
E701 multiple statements on one line (colon)

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:58:37 +03:00
Laurent Pinchart
863e31fa52 utils: raspberrypi: ctt: Fix pycodestyle E228
E228 missing whitespace around modulo operator

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:58:32 +03:00
Laurent Pinchart
641c6ebe9b utils: raspberrypi: ctt: Fix pycodestyle E225
E225 missing whitespace around operator

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13 16:58:22 +03:00