| Message ID | 20251119132221.2088013-2-stefan.klug@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 69a9334112e8..78ba43e39b77 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -437,6 +437,15 @@ template<> std::optional<ipa::Pwl> YamlObject::Getter<ipa::Pwl>::get(const YamlObject &obj) const { + /* Treat a single value as single point PWL */ + if (obj.isValue()) { + auto v = obj.get<double>(); + if (!v) + return std::nullopt; + + return ipa::Pwl({ { { 0.0, *v } } }); + } + if (!obj.size() || obj.size() % 2) return std::nullopt;