@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Af:
- Agc:
@@ -249,9 +249,11 @@ int IPAIPU3::init(const IPASettings &settings,
return -EINVAL;
unsigned int version = (*data)["version"].get<uint32_t>(0);
- if (version != 1) {
+ if (version != 2) {
LOG(IPAIPU3, Error)
- << "Invalid tuning file version " << version;
+ << "The tuning file " << settings.configurationFile
+ << " is version " << version
+ << " but version 2 is required";
return -EINVAL;
}
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -114,6 +114,15 @@ int IPAMaliC55::init(const IPASettings &settings, const IPAConfigInfo &ipaConfig
if (!data)
return -EINVAL;
+ unsigned int version = (*data)["version"].get<uint32_t>(0);
+ if (version != 2) {
+ LOG(IPAMaliC55, Error)
+ << "The tuning file " << settings.configurationFile
+ << " is version " << version
+ << " but version 2 is required";
+ return -EINVAL;
+ }
+
if (!data->contains("algorithms")) {
LOG(IPAMaliC55, Error)
<< "Tuning file doesn't contain any algorithm";
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
AeMeteringMode:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- Agc:
- Awb:
@@ -181,9 +181,11 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,
return -EINVAL;
unsigned int version = (*data)["version"].get<uint32_t>(0);
- if (version != 1) {
+ if (version != 2) {
LOG(IPARkISP1, Error)
- << "Invalid tuning file version " << version;
+ << "The tuning file " << settings.configurationFile
+ << " is version " << version
+ << " but version 2 is required";
return -EINVAL;
}
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
-version: 1
+version: 2
algorithms:
- BlackLevel:
- Awb:
@@ -129,6 +129,14 @@ int IPASoftIsp::init(const IPASettings &settings,
unsigned int version = (*data)["version"].get<uint32_t>(0);
LOG(IPASoftIsp, Debug) << "Tuning file version " << version;
+ if (version != 2) {
+ LOG(IPASoftIsp, Error)
+ << "The tuning file " << settings.configurationFile
+ << " is version " << version
+ << " but version 2 is required";
+ return -EINVAL;
+ }
+
if (!data->contains("algorithms")) {
LOG(IPASoftIsp, Error) << "Tuning file doesn't contain algorithms";
return -EINVAL;
@@ -99,10 +99,10 @@ class YamlOutput(Generator):
out_lines = [
'%YAML 1.1',
'---',
- 'version: 1',
+ 'version: 2',
# No need to condition this, as libtuning already guarantees that
# we have at least one module. Even if the module has no output,
- # its prescence is meaningful.
+ # its presence is meaningful.
'algorithms:'
]
Because of commit 974102049a41 ("libcamera: controls: Remove common enum prefix") the format of the tuning files changed in a backwards incompatible way. To make that very transparent to the users, increment the required tuning file version so that a old tuning file results in an error. Apply these checks to ipu3, mali-c55, rkisp1 and softisp. For user reading this due to the error: To migrate from version 1 to version 2, increment the version entry to 2 and drop the prefix from the following entries: - MeteringCentreWeighted - MeteringSpot - MeteringMatrix - ExposureNormal - ExposureShort - ConstraintNormal - ConstraintHighlight - AwbAuto - AwbIncandescent - AwbTungsten - AwbFluorescent - AwbIndoor - AwbDaylight - AwbCloudy Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- Hi all, I'm not super happy with this patch (hence the RFC) but at least it loudly warns the users. The problems are: - Again more code duplication. But given that we have no central tuning file loading logic this might be acceptable - It errors out in many cases where the tuning files might actually be compatible. E.g. if the tuning file only use the grey world awb. But checking for that specifically would be way more work - It is only compile tested Feedback welcome. Best regards, Stefan --- src/ipa/ipu3/data/uncalibrated.yaml | 2 +- src/ipa/ipu3/ipu3.cpp | 6 ++++-- src/ipa/mali-c55/data/imx415.yaml | 2 +- src/ipa/mali-c55/data/uncalibrated.yaml | 2 +- src/ipa/mali-c55/mali-c55.cpp | 9 +++++++++ src/ipa/rkisp1/data/imx219.yaml | 2 +- src/ipa/rkisp1/data/imx258.yaml | 2 +- src/ipa/rkisp1/data/mira220.yaml | 2 +- src/ipa/rkisp1/data/ov2685.yaml | 2 +- src/ipa/rkisp1/data/ov4689.yaml | 2 +- src/ipa/rkisp1/data/ov5640.yaml | 2 +- src/ipa/rkisp1/data/ov5695.yaml | 2 +- src/ipa/rkisp1/data/ov8858.yaml | 2 +- src/ipa/rkisp1/rkisp1.cpp | 6 ++++-- src/ipa/softisp/data/uncalibrated.yaml | 2 +- src/ipa/softisp/softisp.cpp | 8 ++++++++ utils/tuning/libtuning/generators/yaml_output.py | 4 ++-- 17 files changed, 39 insertions(+), 18 deletions(-)