Commit graph

5 commits

Author SHA1 Message Date
Naushir Patuck
177df04d2b ipa: raspberrypi: Code refactoring to match style guidelines
Refactor all the source files in src/ipa/raspberrypi/ to match the recommended
formatting guidelines for the libcamera project. The vast majority of changes
in this commit comprise of switching from snake_case to CamelCase, and starting
class member functions with a lower case character.

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:12 +03:00
Naushir Patuck
579f55b108 ipa: raspberrypi: Generalise the SMIA metadata parser
Instead of having each CamHelper subclass the MdParserSmia, change the
implementation of MdParserSmia to be more generic. The MdParserSmia now gets
given a list of registers to search for and helper functions are used to compute
exposure lines and gain codes from these registers.

Update the imx219 and imx477 CamHelpers by using this new mechanism.

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>
2021-06-30 23:16:18 +03:00
Naushir Patuck
a4b876e97f ipa: raspberrypi: Fix possible buffer overrun in metadata parsing
The SMIA metadata parser could possibly read one byte past the end of the
buffer as the buffer size test ran after the read operation. Fix this.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.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>
2021-06-22 13:48:01 +03:00
Naushir Patuck
acdc70a1bc ipa: raspberrypi: Non-functional formatting fixes to md_parser_smia.cpp
Adjust source formatting to closer match libcamera guidelines:

- Remove unused header files.
- Switch to C style comments.
- Adjust whitespace for readability.
- Remove retcode local variable usage.

There are no functional changes in this commit.

Signed-off-by: Naushir Patuck <naush@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>
2021-06-15 12:50:05 +03:00
Naushir Patuck
12350a90e8 ipa: raspberrypi: Rename md_parser.cpp to md_parser_smia.cpp
The file implements the MdParserSmia class, so change the file name to reflect
this.

Signed-off-by: Naushir Patuck <naush@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>
2021-06-15 12:50:05 +03:00
Renamed from src/ipa/raspberrypi/md_parser.cpp (Browse further)