| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/components/amdutils.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "amdutils.h"cxx . . $ `<file>/src/core/components/amdutils.h`/ |
| 5 | |
| 6 | #include "common/stringutils.h"cxx . . $ `<file>/src/common/stringutils.h`/ |
| 7 | #include <algorithm> |
| 8 | #include <cstddef> |
| 9 | #include <iterator> |
| 10 | #include <regex> |
| 11 | #include <units.h> |
| 12 | #include <unordered_map> |
| 13 | #include <utility> |
| 14 | |
| 15 | namespace Utilscxx . . $ Utils/::AMDcxx . . $ Utils/AMD/ { |
| 16 | |
| 17 | bool readAMDGPUVRamSizecxx . . $ Utils/AMD/readAMDGPUVRamSize(468db659280385bd).(int deviceFD, unitscxx . . $ units/::datacxx . . $ units/data/::megabyte_tcxx . . $ units/data/megabyte_t# *size) |
| 18 | { |
| 19 | #if defined(DRM_IOCTL_AMDGPU_INFOcxx . . $ `<external>/2199370782417513470/amdgpu_drm.h:66:9`!) && defined(AMDGPU_INFO_MEMORYcxx . . $ `<external>/2199370782417513470/amdgpu_drm.h:1126:9`!) |
| 20 | struct drm_amdgpu_memory_info drm_info = {}; |
| 21 | struct drm_amdgpu_info buffer = {}; |
| 22 | |
| 23 | buffer.query = AMDGPU_INFO_MEMORYcxx . . $ `<external>/2199370782417513470/amdgpu_drm.h:1126:9`!; |
| 24 | buffer.return_pointer = reinterpret_cast<stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t#>(&drm_info); |
| 25 | buffer.return_size = sizeof(drm_info); |
| 26 | |
| 27 | if (ioctl(deviceFD, DRM_IOCTL_AMDGPU_INFOcxx . . $ `<external>/2199370782417513470/amdgpu_drm.h:66:9`!, &buffer) >= 0) { |
| 28 | *size =cxx . . $ units/unit_t#`operator=`(ebc29688b3852cb9). unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::datacxx . . $ units/data/::megabyte_tcxx . . $ units/data/megabyte_t#>( |
| 29 | drm_info.vram.total_heap_size / (1024 * 1024)); |
| 30 | return true; |
| 31 | } |
| 32 | else |
| 33 | return false; |
| 34 | #else |
| 35 | return false; |
| 36 | #endif |
| 37 | } |
| 38 | |
| 39 | bool readRadeonVRamSizecxx . . $ Utils/AMD/readRadeonVRamSize(468db659280385bd).(int deviceFD, unitscxx . . $ units/::datacxx . . $ units/data/::megabyte_tcxx . . $ units/data/megabyte_t# *size) |
| 40 | { |
| 41 | #if defined(DRM_IOCTL_RADEON_GEM_INFOcxx . . $ `<external>/13690409949326740378/radeon_drm.h:548:9`!) |
| 42 | struct drm_radeon_gem_info buffer = {}; |
| 43 | if (ioctl(deviceFD, DRM_IOCTL_RADEON_GEM_INFOcxx . . $ `<external>/13690409949326740378/radeon_drm.h:548:9`!, &buffer) >= 0) { |
| 44 | *size =cxx . . $ units/unit_t#`operator=`(ebc29688b3852cb9). unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::datacxx . . $ units/data/::megabyte_tcxx . . $ units/data/megabyte_t#>(buffer.vram_size / |
| 45 | (1024 * 1024)); |
| 46 | return true; |
| 47 | } |
| 48 | else |
| 49 | return false; |
| 50 | #else |
| 51 | return false; |
| 52 | #endif |
| 53 | } |
| 54 | |
| 55 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>>> |
| 56 | parseDPMStatescxx . . $ Utils/AMD/parseDPMStates(cdb02b20309ce792).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppDpmLines) |
| 57 | { |
| 58 | // Relevant lines format (kernel 4.6+) |
| 59 | // 0: 300Mhz * |
| 60 | // ... |
| 61 | // N: 1303Mhz |
| 62 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(\d+)\s*:\s*(\d+)\s*Mhz\s*\*?\s*$)", |
| 63 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 64 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> statescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 65 | |
| 66 | for (auto const &line : ppDpmLines) { |
| 67 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 68 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) |
| 69 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 70 | |
| 71 | unsigned int index{0}, freq{0}; |
| 72 | if (!(Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 73 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(freq, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2]))) |
| 74 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 75 | |
| 76 | states.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(index, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#(freq)); |
| 77 | } |
| 78 | |
| 79 | if (states.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 80 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 81 | |
| 82 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(states); |
| 83 | } |
| 84 | |
| 85 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<unsigned int> |
| 86 | parseDPMCurrentStateIndexcxx . . $ Utils/AMD/parseDPMCurrentStateIndex(5bd64bb602d44cee).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppDpmLines) |
| 87 | { |
| 88 | // Relevant lines format (kernel 4.6+) |
| 89 | // 0: 300Mhz * |
| 90 | // ... |
| 91 | // N: 1303Mhz |
| 92 | // |
| 93 | // '*' marks the current state |
| 94 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(\d+)\s*:\s*\d+\s*Mhz\s*\*\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 95 | |
| 96 | for (auto const &line : ppDpmLines) { |
| 97 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 98 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 99 | unsigned int index{0}; |
| 100 | if (!Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 101 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 102 | |
| 103 | return indexcxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 108 | } |
| 109 | |
| 110 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, int>>> |
| 111 | parsePowerProfileModeModescxx . . $ Utils/AMD/parsePowerProfileModeModes(8985c67d4d27fa08).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppPowerProfileModeLines) |
| 112 | { |
| 113 | // Relevant lines format: |
| 114 | // 1 3D_FULL_SCREEN *: ... |
| 115 | // 1 3D_FULL_SCREEN: ... |
| 116 | // 1 3D_FULL_SCREEN*: ... |
| 117 | // 1 3D_FULL_SCREEN : ... |
| 118 | // 1 3D_FULL_SCREEN* |
| 119 | // 1 3D_FULL_SCREEN |
| 120 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^\s*(\d+)\s+([^\*\(\s:]+))"); |
| 121 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, int>> modescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 122 | |
| 123 | for (auto const &line : ppPowerProfileModeLines) { |
| 124 | |
| 125 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 126 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) |
| 127 | continue; |
| 128 | |
| 129 | // skip BOOT and CUSTOM modes |
| 130 | stdcxx . . $ std/::stringcxx . . $ std/string# const mode(result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2]); |
| 131 | if (mode.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("BOOT") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos. || |
| 132 | mode.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("CUSTOM") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) |
| 133 | continue; |
| 134 | |
| 135 | int index{0}; |
| 136 | if (!Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 137 | continue; |
| 138 | |
| 139 | modes.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(mode), index); |
| 140 | } |
| 141 | |
| 142 | if (!modes.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 143 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(modes); |
| 144 | |
| 145 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 146 | } |
| 147 | |
| 148 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> parsePowerProfileModeCurrentModeIndexcxx . . $ Utils/AMD/parsePowerProfileModeCurrentModeIndex(8cee9d7a74e8646c).( |
| 149 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppPowerProfileModeLines) |
| 150 | { |
| 151 | // Relevant lines format: |
| 152 | // 1 3D_FULL_SCREEN *: ... |
| 153 | // 1 3D_FULL_SCREEN*: ... |
| 154 | // 1 3D_FULL_SCREEN* |
| 155 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^\s*(\d+)\s+(?:[^\*\(\s]+)\s*\*)"); |
| 156 | |
| 157 | for (auto const &line : ppPowerProfileModeLines) { |
| 158 | |
| 159 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 160 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) |
| 161 | continue; |
| 162 | |
| 163 | int index{0}; |
| 164 | if (!Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 165 | break; |
| 166 | |
| 167 | return indexcxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 168 | } |
| 169 | |
| 170 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 171 | } |
| 172 | |
| 173 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, int>>> |
| 174 | parsePowerProfileModeModesColumnarcxx . . $ Utils/AMD/parsePowerProfileModeModesColumnar(8985c67d4d27fa08).( |
| 175 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppPowerProfileModeLines) |
| 176 | { |
| 177 | // Format of the first line: |
| 178 | // 0 BOOTUP_DEFAULT* 1 3D_FULL_SCREEN 2 POWER_SAVING 3 VIDEO ... |
| 179 | if (ppPowerProfileModeLines.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 180 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 181 | |
| 182 | auto const &data = ppPowerProfileModeLines.frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 183 | |
| 184 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(\s*(\d+)\s+(\w+)\s*\*{0,1})", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 185 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, int>> modescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 186 | |
| 187 | auto targetIt = stdcxx . . $ std/__cxx11/regex_iterator#regex_iterator(7a304ee62df067c3).::sregex_iteratorcxx . . $ std/__cxx11/sregex_iterator#(data.cbegincxx . . $ std/__cxx11/basic_string#cbegin(a865d278ca20c908).(), data.cendcxx . . $ std/__cxx11/basic_string#cend(a865d278ca20c908).(), regex); |
| 188 | while (targetIt != stdcxx . . $ std/__cxx11/regex_iterator#regex_iterator(49f6e7a06ebc5aa8).::sregex_iteratorcxx . . $ std/__cxx11/sregex_iterator#()) { |
| 189 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# match = *cxx . . $ std/__cxx11/match_results#match_results(fc284761c25540a5).targetIt; |
| 190 | |
| 191 | // skip BOOT and CUSTOM modes |
| 192 | stdcxx . . $ std/::stringcxx . . $ std/string# const mode(match[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2]); |
| 193 | if (mode.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("BOOT") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos. || |
| 194 | mode.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("CUSTOM") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) { |
| 195 | targetIt =cxx . . $ std/__cxx11/regex_iterator#`operator=`(450210c197bed1c8). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetItcxx . . $ std/__cxx11/regex_iterator#regex_iterator(f39209393c6356fa).); |
| 196 | continue; |
| 197 | } |
| 198 | |
| 199 | int index{0}; |
| 200 | if (!Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(index, match[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) { |
| 201 | targetIt =cxx . . $ std/__cxx11/regex_iterator#`operator=`(450210c197bed1c8). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetItcxx . . $ std/__cxx11/regex_iterator#regex_iterator(f39209393c6356fa).); |
| 202 | continue; |
| 203 | } |
| 204 | |
| 205 | modes.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(mode), index); |
| 206 | targetIt =cxx . . $ std/__cxx11/regex_iterator#`operator=`(450210c197bed1c8). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetItcxx . . $ std/__cxx11/regex_iterator#regex_iterator(f39209393c6356fa).); |
| 207 | } |
| 208 | |
| 209 | if (!modes.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 210 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(modes); |
| 211 | |
| 212 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 213 | } |
| 214 | |
| 215 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> parsePowerProfileModeCurrentModeIndexColumnarcxx . . $ Utils/AMD/parsePowerProfileModeCurrentModeIndexColumnar(8cee9d7a74e8646c).( |
| 216 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppPowerProfileModeLines) |
| 217 | { |
| 218 | // Format of the first line: |
| 219 | // 0 BOOTUP_DEFAULT* 1 3D_FULL_SCREEN 2 POWER_SAVING 3 VIDEO ... |
| 220 | if (ppPowerProfileModeLines.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 221 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 222 | |
| 223 | auto const &data = ppPowerProfileModeLines.frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 224 | |
| 225 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(\s*(\d+)\s+\w+\s*\*)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 226 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 227 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(data, result, regex)) |
| 228 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 229 | |
| 230 | int index{0}; |
| 231 | if (!Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 232 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 233 | |
| 234 | return indexcxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 235 | } |
| 236 | |
| 237 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, |
| 238 | unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 239 | parseOverdriveClkVoltLinecxx . . $ Utils/AMD/parseOverdriveClkVoltLine(b5047773ba57749f).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 240 | { |
| 241 | // Relevant lines format (kernel 4.17+): |
| 242 | // ... |
| 243 | // 0: 300MHz 800mV |
| 244 | // |
| 245 | // On Navi ASICs: |
| 246 | // ... |
| 247 | // 0: 300MHz @ 800mV |
| 248 | // ... |
| 249 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"((\d+)\s*:\s*(\d+)\s*MHz[\s@]*(\d+)\s*mV\s*$)", |
| 250 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 251 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 252 | |
| 253 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 254 | unsigned int index{0}, freq{0}, volt{0}; |
| 255 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 256 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(freq, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2]) && |
| 257 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(volt, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).3])) |
| 258 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_tuplecxx . . $ std/make_tuple(3964edbfd7e8599f).(index, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#(freq), |
| 259 | unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#(volt)); |
| 260 | } |
| 261 | |
| 262 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 263 | } |
| 264 | |
| 265 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, |
| 266 | unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>>> |
| 267 | parseOverdriveClksVoltscxx . . $ Utils/AMD/parseOverdriveClksVolts(d26aca23e654d0e2).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName, |
| 268 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 269 | { |
| 270 | // Relevant lines format (kernel 4.17+): |
| 271 | // ... |
| 272 | // OD_controlName: |
| 273 | // ... |
| 274 | // OD_otherLbl: |
| 275 | // ... |
| 276 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 277 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 278 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 279 | return line.findcxx . . $ std/__cxx11/basic_string#find(f41b2cffd8eea408).("OD_" +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::stringcxx . . $ std/string#(controlName) +cxx . . $ std/operator+(900ec9581c410ad9). ":") != |
| 280 | stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 281 | }); |
| 282 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 283 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 284 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 285 | |
| 286 | auto endIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(targetIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 287 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 288 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 289 | }); |
| 290 | |
| 291 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, |
| 292 | unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 293 | statescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 294 | |
| 295 | while (targetIt != endIt) { |
| 296 | auto state = parseOverdriveClkVoltLinecxx . . $ Utils/AMD/parseOverdriveClkVoltLine(b5047773ba57749f).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 297 | if (state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 298 | states.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).state)); |
| 299 | |
| 300 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 301 | } |
| 302 | |
| 303 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(states); |
| 304 | } |
| 305 | |
| 306 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 307 | } |
| 308 | |
| 309 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> |
| 310 | parseOverdriveClkRangecxx . . $ Utils/AMD/parseOverdriveClkRange(206cc02aba6815b1).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 311 | { |
| 312 | // Relevant lines format (kernel 4.18+): |
| 313 | // ... |
| 314 | // Lbl...: 400MHz 500MHz |
| 315 | // ... |
| 316 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(?:[^\:\s]+)\s*:\s*(\d+)\s*MHz\s*(\d+)\s*MHz\s*$)", |
| 317 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 318 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 319 | |
| 320 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 321 | int min{0}, max{0}; |
| 322 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 323 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 324 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>(min), |
| 325 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>(max)); |
| 326 | } |
| 327 | |
| 328 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 329 | } |
| 330 | |
| 331 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> |
| 332 | parseOverdriveClkRangecxx . . $ Utils/AMD/parseOverdriveClkRange(4e35453e7c70f57d).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName, |
| 333 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 334 | { |
| 335 | // Relevant lines format (kernel 4.18+): |
| 336 | // ... |
| 337 | // OD_RANGE: |
| 338 | // ... |
| 339 | // controlName: min max |
| 340 | // ... |
| 341 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 342 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 343 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 344 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 345 | }); |
| 346 | if (rangeIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 347 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 348 | rangeIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 349 | return line.findcxx . . $ std/__cxx11/basic_string#find(f41b2cffd8eea408).(stdcxx . . $ std/::stringcxx . . $ std/string#(controlName) +cxx . . $ std/operator+(900ec9581c410ad9). ":") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 350 | }); |
| 351 | |
| 352 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 353 | return parseOverdriveClkRangecxx . . $ Utils/AMD/parseOverdriveClkRange(206cc02aba6815b1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 354 | } |
| 355 | |
| 356 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 357 | } |
| 358 | |
| 359 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 360 | parseOverdriveVoltRangeLinecxx . . $ Utils/AMD/parseOverdriveVoltRangeLine(99baf96bfd7afce1).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 361 | { |
| 362 | // Relevant lines format (kernel 4.18+): |
| 363 | // ... |
| 364 | // Lbl...: 400mV 500mV |
| 365 | // ... |
| 366 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(?:[^\:\s]+)\s*:\s*(\d+)\s*mV\s*(\d+)\s*mV\s*$)", |
| 367 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 368 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 369 | |
| 370 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 371 | int min{0}, max{0}; |
| 372 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 373 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 374 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>(min), |
| 375 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>(max)); |
| 376 | } |
| 377 | |
| 378 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 379 | } |
| 380 | |
| 381 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 382 | parseOverdriveVoltRangecxx . . $ Utils/AMD/parseOverdriveVoltRange(113e4b1ae9456da).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 383 | { |
| 384 | // Relevant lines format (kernel 4.18+): |
| 385 | // ... |
| 386 | // OD_RANGE: |
| 387 | // ... |
| 388 | // VDDC: min max |
| 389 | // ... |
| 390 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 391 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 392 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 393 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 394 | }); |
| 395 | if (rangeIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 396 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 397 | rangeIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 398 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("VDDC:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 399 | }); |
| 400 | |
| 401 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 402 | return parseOverdriveVoltRangeLinecxx . . $ Utils/AMD/parseOverdriveVoltRangeLine(99baf96bfd7afce1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 403 | } |
| 404 | |
| 405 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 406 | } |
| 407 | |
| 408 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> |
| 409 | parseOverdriveClksLinecxx . . $ Utils/AMD/parseOverdriveClksLine(818c637c4501e537).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 410 | { |
| 411 | // Relevant lines format (kernel 4.20+): |
| 412 | // ... |
| 413 | // 0: 300MHz |
| 414 | // ... |
| 415 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(\d+)\s*:\s*(\d+)\s*MHz\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 416 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 417 | |
| 418 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 419 | unsigned int index{0}, freq{0}; |
| 420 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 421 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(freq, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 422 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(index, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#(freq)); |
| 423 | } |
| 424 | |
| 425 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 426 | } |
| 427 | |
| 428 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>>> |
| 429 | parseOverdriveClkscxx . . $ Utils/AMD/parseOverdriveClks(b2cc1378e72e9acc).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName, |
| 430 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 431 | { |
| 432 | // Relevant lines format (kernel 4.17+): |
| 433 | // ... |
| 434 | // OD_controlName: |
| 435 | // ... |
| 436 | // OD_otherLbl: |
| 437 | // ... |
| 438 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 439 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 440 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 441 | return line.findcxx . . $ std/__cxx11/basic_string#find(f41b2cffd8eea408).("OD_" +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::stringcxx . . $ std/string#(controlName) +cxx . . $ std/operator+(900ec9581c410ad9). ":") != |
| 442 | stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 443 | }); |
| 444 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 445 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 446 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 447 | |
| 448 | auto endIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(targetIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 449 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 450 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 451 | }); |
| 452 | |
| 453 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<unsigned int, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> statescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 454 | |
| 455 | while (targetIt != endIt) { |
| 456 | auto state = parseOverdriveClksLinecxx . . $ Utils/AMD/parseOverdriveClksLine(818c637c4501e537).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 457 | if (state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 458 | states.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).state)); |
| 459 | |
| 460 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 461 | } |
| 462 | |
| 463 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(states); |
| 464 | } |
| 465 | |
| 466 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 467 | } |
| 468 | |
| 469 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#< |
| 470 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>>> |
| 471 | parseOverdriveVoltCurvecxx . . $ Utils/AMD/parseOverdriveVoltCurve(2ccca4df9cb60095).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 472 | { |
| 473 | // Relevant lines format (kernel 4.20+): |
| 474 | // ... |
| 475 | // OD_VDDC_CURVE: |
| 476 | // 0: 700Mhz 800mV |
| 477 | // ... |
| 478 | // OD_RANGE: |
| 479 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 480 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 481 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 482 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_VDDC_CURVE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 483 | }); |
| 484 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 485 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 486 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 487 | |
| 488 | auto endIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(targetIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 489 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 490 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 491 | }); |
| 492 | |
| 493 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 494 | pointscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 495 | |
| 496 | while (targetIt != endIt) { |
| 497 | auto state = parseOverdriveClkVoltLinecxx . . $ Utils/AMD/parseOverdriveClkVoltLine(b5047773ba57749f).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 498 | if (state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 499 | auto &[_, freq, volt] = *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).state; |
| 500 | points.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).(freq, volt)); |
| 501 | } |
| 502 | |
| 503 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 504 | } |
| 505 | |
| 506 | if (!points.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 507 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(points); |
| 508 | } |
| 509 | |
| 510 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 511 | } |
| 512 | |
| 513 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#< |
| 514 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>, |
| 515 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>>>> |
| 516 | parseOverdriveVoltCurveRangecxx . . $ Utils/AMD/parseOverdriveVoltCurveRange(8d57ccfd9e24880a).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 517 | { |
| 518 | // Relevant lines format (kernel 4.20+): |
| 519 | // ... |
| 520 | // OD_RANGE: |
| 521 | // ... |
| 522 | // VDDC_CURVE_SCLK[0]: 808Mhz 2200Mhz |
| 523 | // VDDC_CURVE_VOLT[0]: 738mV 1218mV |
| 524 | // ... |
| 525 | // VDDC_CURVE_SCLK[N]: 808Mhz 2200Mhz |
| 526 | // VDDC_CURVE_VOLT[N]: 738mV 1218mV |
| 527 | // ... |
| 528 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 529 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 530 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 531 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 532 | }); |
| 533 | if (rangeIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 534 | |
| 535 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#< |
| 536 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>, |
| 537 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>>> |
| 538 | rangescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 539 | |
| 540 | auto freqIt = stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(rangeIt); |
| 541 | |
| 542 | // skip lines not starting with VDDC_CURVE_ |
| 543 | freqIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 544 | freqIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 545 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("VDDC_CURVE_") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 546 | }); |
| 547 | |
| 548 | while (freqIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 549 | (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).freqIt).findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("VDDC_CURVE_SCLK[") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) { |
| 550 | |
| 551 | auto voltIt = stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(freqIt); |
| 552 | if (voltIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 553 | (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).voltIt).findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("VDDC_CURVE_VOLT[") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) { |
| 554 | |
| 555 | auto freqRange = parseOverdriveClkRangecxx . . $ Utils/AMD/parseOverdriveClkRange(206cc02aba6815b1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).freqIt); |
| 556 | auto voltRange = parseOverdriveVoltRangeLinecxx . . $ Utils/AMD/parseOverdriveVoltRangeLine(99baf96bfd7afce1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).voltIt); |
| 557 | |
| 558 | if (freqRange.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && voltRange.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 559 | ranges.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 560 | stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).freqRange), stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).voltRange))); |
| 561 | else |
| 562 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; // invalid data format |
| 563 | } |
| 564 | else |
| 565 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; // invalid data format |
| 566 | |
| 567 | freqIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(voltIt); |
| 568 | } |
| 569 | |
| 570 | if (!ranges.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 571 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(ranges); |
| 572 | } |
| 573 | |
| 574 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 575 | } |
| 576 | |
| 577 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#> |
| 578 | parseOverdriveVoltOffsetcxx . . $ Utils/AMD/parseOverdriveVoltOffset(62a94145c9d828aa).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 579 | { |
| 580 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 581 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 582 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 583 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_VDDGFX_OFFSET:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 584 | }); |
| 585 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 586 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 587 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(-?\d+)\s*mV\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 588 | |
| 589 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 590 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt), result, regex)) { |
| 591 | int value; |
| 592 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).(value, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 593 | return unitscxx . . $ std/optional#optional(e3f0d6382bd52f24).::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#(value); |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 598 | } |
| 599 | |
| 600 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 601 | parseOverdriveVoltOffsetRangeLinecxx . . $ Utils/AMD/parseOverdriveVoltOffsetRangeLine(99baf96bfd7afce1).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 602 | { |
| 603 | // Relevant lines format (kernel 6.14+): |
| 604 | // ... |
| 605 | // label: -200mv 0mv |
| 606 | // ... |
| 607 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(?:[^\:\s]+)\s*:\s*(-?\d+)\s*mV\s*(\d+)\s*mV\s*$)", |
| 608 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 609 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 610 | |
| 611 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 612 | int min{0}, max{0}; |
| 613 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 614 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 615 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>(min), |
| 616 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>(max)); |
| 617 | } |
| 618 | |
| 619 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 620 | } |
| 621 | |
| 622 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#, unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#>> |
| 623 | parseOverdriveVoltOffsetRangecxx . . $ Utils/AMD/parseOverdriveVoltOffsetRange(113e4b1ae9456da).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 624 | { |
| 625 | // Relevant lines format (kernel 6.14+): |
| 626 | // ... |
| 627 | // OD_RANGE: |
| 628 | // ... |
| 629 | // VDDGFX_OFFSET: -200mv 0mv |
| 630 | // ... |
| 631 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 632 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 633 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 634 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 635 | }); |
| 636 | if (rangeIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 637 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 638 | rangeIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 639 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("VDDGFX_OFFSET:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 640 | }); |
| 641 | |
| 642 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 643 | return parseOverdriveVoltOffsetRangeLinecxx . . $ Utils/AMD/parseOverdriveVoltOffsetRangeLine(99baf96bfd7afce1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 644 | } |
| 645 | |
| 646 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 647 | } |
| 648 | |
| 649 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>> |
| 650 | parseOverdriveClkControlscxx . . $ Utils/AMD/parseOverdriveClkControls(16615915c492e6b0).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 651 | { |
| 652 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^OD_(\wCLK):\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 653 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> controlNamescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 654 | |
| 655 | for (auto const &line : ppOdClkVoltageLines) { |
| 656 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 657 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) |
| 658 | continue; |
| 659 | |
| 660 | controlNames.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]); |
| 661 | } |
| 662 | |
| 663 | if (!controlNames.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 664 | return controlNamescxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 665 | |
| 666 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 667 | } |
| 668 | |
| 669 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> |
| 670 | getOverdriveClkControlCmdIdcxx . . $ Utils/AMD/getOverdriveClkControlCmdId(904f61f3a16c5694).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName) |
| 671 | { |
| 672 | static stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<stdcxx . . $ std/::string_viewcxx . . $ std/string_view#, stdcxx . . $ std/::stringcxx . . $ std/string#> const nameCmdIdMapcxx . . $ std/unordered_map#unordered_map(715c419ed25a2697).{ |
| 673 | {"SCLK", "s"}, {"MCLK", "m"}}; |
| 674 | |
| 675 | if (nameCmdIdMap.countcxx . . $ std/unordered_map#count(b71ff106d381144b).(controlName) > 0) |
| 676 | return nameCmdIdMapcxx . . $ std/optional#optional(e3f0d6382bd52f24)..atcxx . . $ std/unordered_map#at(7589f80bac630479).(controlName); |
| 677 | |
| 678 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 679 | } |
| 680 | |
| 681 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> |
| 682 | getOverdriveClkOffsetControlCmdIdcxx . . $ Utils/AMD/getOverdriveClkOffsetControlCmdId(904f61f3a16c5694).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName) |
| 683 | { |
| 684 | // NOTE: Clock offsets implementation uses the same command ids of clock |
| 685 | // control commands. This deviates from the voltage offset command, which is |
| 686 | // terminated by the 'o' character. |
| 687 | return getOverdriveClkControlCmdIdcxx . . $ Utils/AMD/getOverdriveClkControlCmdId(904f61f3a16c5694).(controlNamecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).); |
| 688 | } |
| 689 | |
| 690 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>> parseOverdriveClkOffsetControlscxx . . $ Utils/AMD/parseOverdriveClkOffsetControls(16615915c492e6b0).( |
| 691 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 692 | { |
| 693 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^OD_(\wCLK)_OFFSET:\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 694 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> controlNamescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 695 | |
| 696 | for (auto const &line : ppOdClkVoltageLines) { |
| 697 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 698 | if (!stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) |
| 699 | continue; |
| 700 | |
| 701 | controlNames.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]); |
| 702 | } |
| 703 | |
| 704 | if (!controlNames.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 705 | return controlNamescxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 706 | |
| 707 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 708 | } |
| 709 | |
| 710 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#> |
| 711 | parseOverdriveClkOffsetLinecxx . . $ Utils/AMD/parseOverdriveClkOffsetLine(640e463894ae366).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 712 | { |
| 713 | // Relevant lines format (kernel 6.14+): |
| 714 | // OD_SCLK_OFFSET: |
| 715 | // -200MHz |
| 716 | // ... |
| 717 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(-?\d+)\s*Mhz\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 718 | |
| 719 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 720 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 721 | int value; |
| 722 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).(value, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 723 | return unitscxx . . $ std/optional#optional(e3f0d6382bd52f24).::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#(value); |
| 724 | } |
| 725 | |
| 726 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 727 | } |
| 728 | |
| 729 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#> |
| 730 | parseOverdriveClkOffsetcxx . . $ Utils/AMD/parseOverdriveClkOffset(eeedcb8f25e62274).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName, |
| 731 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 732 | { |
| 733 | // Relevant lines format (kernel 6.14+): |
| 734 | // ... |
| 735 | // OD_controlName_OFFSET: |
| 736 | // -100Mhz |
| 737 | // OD_otherLbl: |
| 738 | // ... |
| 739 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 740 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 741 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 742 | return line.findcxx . . $ std/__cxx11/basic_string#find(f41b2cffd8eea408).("OD_" +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::stringcxx . . $ std/string#(controlName) +cxx . . $ std/operator+(900ec9581c410ad9). "_OFFSET:") != |
| 743 | stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 744 | }); |
| 745 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 746 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 747 | return parseOverdriveClkOffsetLinecxx . . $ Utils/AMD/parseOverdriveClkOffsetLine(640e463894ae366).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt)); |
| 748 | |
| 749 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 750 | } |
| 751 | |
| 752 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> |
| 753 | parseOverdriveClkRangeLinecxx . . $ Utils/AMD/parseOverdriveClkRangeLine(206cc02aba6815b1).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 754 | { |
| 755 | // Relevant lines format (kernel 6.14+): |
| 756 | // ... |
| 757 | // label: -500Mhz 1000Mhz |
| 758 | // ... |
| 759 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^(?:[^\:\s]+)\s*:\s*(-?\d+)\s*Mhz\s*(\d+)\s*Mhz\s*$)", |
| 760 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 761 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 762 | |
| 763 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 764 | int min{0}, max{0}; |
| 765 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 766 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 767 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>(min), |
| 768 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>(max)); |
| 769 | } |
| 770 | |
| 771 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 772 | } |
| 773 | |
| 774 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#, unitscxx . . $ units/::frequencycxx . . $ units/frequency/::megahertz_tcxx . . $ units/frequency/megahertz_t#>> |
| 775 | parseOverdriveClkOffsetRangecxx . . $ Utils/AMD/parseOverdriveClkOffsetRange(4e35453e7c70f57d).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# controlName, |
| 776 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 777 | { |
| 778 | // Relevant lines format (kernel 6.14+): |
| 779 | // ... |
| 780 | // OD_RANGE: |
| 781 | // ... |
| 782 | // controlName_OFFSET: -500Mhz 1000Mhz |
| 783 | // ... |
| 784 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 785 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 786 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 787 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 788 | }); |
| 789 | if (rangeIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 790 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 791 | rangeIt, ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 792 | return line.findcxx . . $ std/__cxx11/basic_string#find(f41b2cffd8eea408).(stdcxx . . $ std/::stringcxx . . $ std/string#(controlName) +cxx . . $ std/operator+(900ec9581c410ad9). "_OFFSET:") != |
| 793 | stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 794 | }); |
| 795 | |
| 796 | if (targetIt != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 797 | return parseOverdriveClkRangeLinecxx . . $ Utils/AMD/parseOverdriveClkRangeLine(206cc02aba6815b1).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 798 | } |
| 799 | |
| 800 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 801 | } |
| 802 | |
| 803 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned int>> ppOdClkVoltageFreqRangeOutOfRangeStatescxx . . $ Utils/AMD/ppOdClkVoltageFreqRangeOutOfRangeStates(2b5d6ac406ca7b24).( |
| 804 | stdcxx . . $ std/::stringcxx . . $ std/string# const &controlName, |
| 805 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 806 | { |
| 807 | // Search for out of range frequency clocks (RX6X00 XT) |
| 808 | // ... |
| 809 | // "OD_MCLK:", |
| 810 | // "0: 97Mhz", |
| 811 | // ... |
| 812 | // "OD_RANGE:", |
| 813 | // ... |
| 814 | // "MCLK: 674Mhz 1200Mhz", |
| 815 | auto clks = parseOverdriveClkscxx . . $ Utils/AMD/parseOverdriveClks(b2cc1378e72e9acc).(controlName, ppOdClkVoltageLines); |
| 816 | auto range = parseOverdriveClkRangecxx . . $ Utils/AMD/parseOverdriveClkRange(4e35453e7c70f57d).(controlName, ppOdClkVoltageLines); |
| 817 | if (!(clks.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && range.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).())) |
| 818 | return stdcxx . . $ std/optional#optional(eb2253fdec8870b5).::nulloptcxx . . $ std/nullopt.; |
| 819 | |
| 820 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned int> statescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 821 | auto [min, max] = *cxx . . $ std/pair#pair(31533a781ed7dba3).range; |
| 822 | for (auto const &[index, clk] : *cxx . . $ std/optional#`operator*`(47e1a15210ec6306).clks) { |
| 823 | if (!(clk >=cxx . . $ units/unit_t#`operator>=`(9aef86f709355c52). min && clk <=cxx . . $ units/unit_t#`operator<=`(9aef86f709355c52). max)) |
| 824 | states.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(index); |
| 825 | } |
| 826 | |
| 827 | if (!states.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 828 | return statescxx . . $ std/optional#optional(e3f0d6382bd52f24).; |
| 829 | |
| 830 | return stdcxx . . $ std/optional#optional(eb2253fdec8870b5).::nulloptcxx . . $ std/nullopt.; |
| 831 | } |
| 832 | |
| 833 | bool ppOdClkVoltageHasKnownFreqVoltQuirkscxx . . $ Utils/AMD/ppOdClkVoltageHasKnownFreqVoltQuirks(937f4a479046c89c).( |
| 834 | stdcxx . . $ std/::stringcxx . . $ std/string# const &, stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 835 | { |
| 836 | // Check for missing range section (kernel < 4.18) |
| 837 | auto odRangeIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 838 | ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 839 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { return line ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "OD_RANGE:"; }); |
| 840 | if (odRangeIter ==cxx . . $ __gnu_cxx/`operator==`(d2eded1addd76ab7). ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 841 | return true; |
| 842 | |
| 843 | return false; |
| 844 | } |
| 845 | |
| 846 | bool ppOdClkVoltageHasKnownVoltCurveQuirkscxx . . $ Utils/AMD/ppOdClkVoltageHasKnownVoltCurveQuirks(93f8d79ff69eedd8).( |
| 847 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &ppOdClkVoltageLines) |
| 848 | { |
| 849 | // Check for voltage incomplete curve points (navi on kernel < 5.6) |
| 850 | // "OD_VDDC_CURVE:", |
| 851 | // "0: 700Mhz @ 0mV", |
| 852 | auto atIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(ppOdClkVoltageLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), |
| 853 | ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 854 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 855 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("@") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 856 | }); |
| 857 | if (atIter != ppOdClkVoltageLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 858 | auto points = parseOverdriveVoltCurvecxx . . $ Utils/AMD/parseOverdriveVoltCurve(2ccca4df9cb60095).(ppOdClkVoltageLines); |
| 859 | if (!points.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) |
| 860 | return true; |
| 861 | |
| 862 | return points->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).atcxx . . $ std/vector#at(428bb168810b9e52).(0).secondcxx . . $ std/pair#second. ==cxx . . $ units/unit_t#`operator==`(9aef86f709355c52). unitscxx . . $ units/::voltagecxx . . $ units/voltage/::millivolt_tcxx . . $ units/voltage/millivolt_t#(0); |
| 863 | } |
| 864 | |
| 865 | return false; |
| 866 | } |
| 867 | |
| 868 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, |
| 869 | unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>> |
| 870 | parseOverdriveFanCurveLinecxx . . $ Utils/AMD/parseOverdriveFanCurveLine(75323d198baacf2d).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 871 | { |
| 872 | // Relevant lines format (kernel 6.7+): |
| 873 | // ... |
| 874 | // 0: 45C 15% |
| 875 | // ... |
| 876 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"((\d+)\s*:\s*(\d+)\s*C\s*(\d+)\s*%\s*$)", |
| 877 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 878 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 879 | |
| 880 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 881 | unsigned int index{0}, temp{0}, speed{0}; |
| 882 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(index, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 883 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(temp, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2]) && |
| 884 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<unsigned int>(speed, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).3])) |
| 885 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_tuplecxx . . $ std/make_tuple(3964edbfd7e8599f).(index, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#(temp), |
| 886 | unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#(speed)); |
| 887 | } |
| 888 | |
| 889 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 890 | } |
| 891 | |
| 892 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, |
| 893 | unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>>> |
| 894 | parseOverdriveFanCurvecxx . . $ Utils/AMD/parseOverdriveFanCurve(8a3e65c721ba067a).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanCurveLines) |
| 895 | { |
| 896 | // Relevant lines format (kernel 6.7+): |
| 897 | // OD_FAN_CURVE: |
| 898 | // 0: 0C 0% |
| 899 | // 1: 45C 15% |
| 900 | // 2: 50C 30% |
| 901 | // 3: 55C 70% |
| 902 | // 4: 65C 100% |
| 903 | // OD_RANGE: |
| 904 | |
| 905 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 906 | fanCurveLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 907 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_FAN_CURVE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 908 | }); |
| 909 | if (targetIt != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 910 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 911 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 912 | |
| 913 | auto endIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(targetIt, fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 914 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 915 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 916 | }); |
| 917 | |
| 918 | bool invalidPointData = false; |
| 919 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::tuplecxx . . $ std/tuple#<unsigned int, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, |
| 920 | unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>> |
| 921 | pointscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 922 | |
| 923 | while (targetIt != endIt) { |
| 924 | auto point = parseOverdriveFanCurveLinecxx . . $ Utils/AMD/parseOverdriveFanCurveLine(75323d198baacf2d).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 925 | if (point.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 926 | points.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).point)); |
| 927 | } |
| 928 | else { |
| 929 | invalidPointData = true; |
| 930 | break; |
| 931 | } |
| 932 | |
| 933 | targetIt =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(ff1991cdf94b87cb). stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt); |
| 934 | } |
| 935 | |
| 936 | if (!points.emptycxx . . $ std/vector#empty(3482b152b9333168).() && !invalidPointData) |
| 937 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::movecxx . . $ std/move(e35c19a1ba7baa26).(points); |
| 938 | } |
| 939 | |
| 940 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 941 | } |
| 942 | |
| 943 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>> |
| 944 | parseOverdriveFanCurveTempRangeLinecxx . . $ Utils/AMD/parseOverdriveFanCurveTempRangeLine(e53f0ddd3f4e5b6e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 945 | { |
| 946 | // Relevant lines format (kernel 6.7+): |
| 947 | // ... |
| 948 | // FAN_CURVE(hotspot temp): 25C 100C |
| 949 | // ... |
| 950 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^.+\s*:\s*(\d+)\s*C\s*(\d+)\s*C\s*$)", |
| 951 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 952 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 953 | |
| 954 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 955 | int min{0}, max{0}; |
| 956 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 957 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 958 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).(unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>(min), |
| 959 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>(max)); |
| 960 | } |
| 961 | |
| 962 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 963 | } |
| 964 | |
| 965 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>> |
| 966 | parseOverdriveFanCurveTempRangecxx . . $ Utils/AMD/parseOverdriveFanCurveTempRange(702df411cb3cfc02).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanCurveLines) |
| 967 | { |
| 968 | // Relevant lines format (kernel 6.7+): |
| 969 | // ... |
| 970 | // OD_RANGE: |
| 971 | // ... |
| 972 | // FAN_CURVE(hotspot temp): 25C 100C |
| 973 | // ... |
| 974 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 975 | fanCurveLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 976 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 977 | }); |
| 978 | if (rangeIt != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 979 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^FAN_CURVE\s*\(\w+\s+temp\)\s*:)", |
| 980 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 981 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 982 | rangeIt, fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 983 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 984 | return stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex); |
| 985 | }); |
| 986 | |
| 987 | if (targetIt != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 988 | return parseOverdriveFanCurveTempRangeLinecxx . . $ Utils/AMD/parseOverdriveFanCurveTempRangeLine(e53f0ddd3f4e5b6e).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 989 | } |
| 990 | |
| 991 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 992 | } |
| 993 | |
| 994 | stdcxx . . $ std/::optionalcxx . . $ std/optional#< |
| 995 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#, unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>> |
| 996 | parseOverdriveFanCurveSpeedRangeLinecxx . . $ Utils/AMD/parseOverdriveFanCurveSpeedRangeLine(dd81db9f474cd48f).(stdcxx . . $ std/::stringcxx . . $ std/string# const &line) |
| 997 | { |
| 998 | // Relevant lines format (kernel 6.7+): |
| 999 | // ... |
| 1000 | // FAN_CURVE(fan speed): 0% 100% |
| 1001 | // ... |
| 1002 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^.+\s*:\s*(\d+)\s*%\s*(\d+)\s*%\s*$)", |
| 1003 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1004 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1005 | |
| 1006 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex)) { |
| 1007 | int min{0}, max{0}; |
| 1008 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 1009 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 1010 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).( |
| 1011 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>(min), |
| 1012 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>(max)); |
| 1013 | } |
| 1014 | |
| 1015 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 1016 | } |
| 1017 | |
| 1018 | stdcxx . . $ std/::optionalcxx . . $ std/optional#< |
| 1019 | stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#, unitscxx . . $ units/::concentrationcxx . . $ units/concentration/::percent_tcxx . . $ units/concentration/percent_t#>> |
| 1020 | parseOverdriveFanCurveSpeedRangecxx . . $ Utils/AMD/parseOverdriveFanCurveSpeedRange(7878c50ecf06320a).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanCurveLines) |
| 1021 | { |
| 1022 | // Relevant lines format (kernel 6.7+): |
| 1023 | // ... |
| 1024 | // OD_RANGE: |
| 1025 | // ... |
| 1026 | // FAN_CURVE(fan speed): 0% 100% |
| 1027 | // ... |
| 1028 | auto rangeIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1029 | fanCurveLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1030 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1031 | }); |
| 1032 | if (rangeIt != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1033 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^FAN_CURVE\s*\(\w+\s+speed\)\s*:)", |
| 1034 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1035 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1036 | rangeIt, fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1037 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1038 | return stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(line, result, regex); |
| 1039 | }); |
| 1040 | |
| 1041 | if (targetIt != fanCurveLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 1042 | return parseOverdriveFanCurveSpeedRangeLinecxx . . $ Utils/AMD/parseOverdriveFanCurveSpeedRangeLine(dd81db9f474cd48f).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).targetIt); |
| 1043 | } |
| 1044 | |
| 1045 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 1046 | } |
| 1047 | |
| 1048 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<bool> |
| 1049 | parseOverdriveFanStopcxx . . $ Utils/AMD/parseOverdriveFanStop(b63c64391664ddd3).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanStopLines) |
| 1050 | { |
| 1051 | // Relevant lines format (kernel 6.13+): |
| 1052 | // FAN_ZERO_RPM_ENABLE: |
| 1053 | // 1 |
| 1054 | // OD_RANGE: |
| 1055 | // ZERO_RPM_ENABLE: 0 1 |
| 1056 | |
| 1057 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1058 | fanStopLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanStopLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1059 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("FAN_ZERO_RPM_ENABLE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1060 | }); |
| 1061 | if (targetIt != fanStopLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 1062 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != fanStopLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1063 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^\s*(\d+)\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1064 | |
| 1065 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1066 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt), result, regex)) { |
| 1067 | int value; |
| 1068 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).(value, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 1069 | return valuecxx . . $ std/optional#optional(e3f0d6382bd52f24). > 0; |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 1074 | } |
| 1075 | |
| 1076 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#> |
| 1077 | parseOverdriveFanStopTempcxx . . $ Utils/AMD/parseOverdriveFanStopTemp(b5c68bef25393fa5).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanStopTempLines) |
| 1078 | { |
| 1079 | // Relevant lines format (kernel 6.13+): |
| 1080 | // FAN_ZERO_RPM_STOP_TEMPERATURE: |
| 1081 | // 20 |
| 1082 | // OD_RANGE: |
| 1083 | // ZERO_RPM_STOP_TEMPERATURE: 10 100 |
| 1084 | |
| 1085 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1086 | fanStopTempLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 1087 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1088 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("FAN_ZERO_RPM_STOP_TEMPERATURE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1089 | }); |
| 1090 | if (targetIt != fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 1091 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1092 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^\s*(-?\d+)\s*$)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1093 | |
| 1094 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1095 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt), result, regex)) { |
| 1096 | int value; |
| 1097 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).(value, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1])) |
| 1098 | return unitscxx . . $ std/optional#optional(e3f0d6382bd52f24).::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#(value); |
| 1099 | } |
| 1100 | } |
| 1101 | |
| 1102 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 1103 | } |
| 1104 | |
| 1105 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::paircxx . . $ std/pair#<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#, unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>> |
| 1106 | parseOverdriveFanStopTempRangecxx . . $ Utils/AMD/parseOverdriveFanStopTempRange(702df411cb3cfc02).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &fanStopTempLines) |
| 1107 | { |
| 1108 | // Relevant lines format (kernel 6.13+): |
| 1109 | // FAN_ZERO_RPM_STOP_TEMPERATURE: |
| 1110 | // 20 |
| 1111 | // OD_RANGE: |
| 1112 | // ZERO_RPM_STOP_TEMPERATURE: 10 100 |
| 1113 | |
| 1114 | auto targetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1115 | fanStopTempLines.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 1116 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1117 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_RANGE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1118 | }); |
| 1119 | if (targetIt != fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && |
| 1120 | stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt) != fanStopTempLines.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1121 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^ZERO_RPM_STOP_TEMPERATURE\s*:\s*(\d+)\s*(\d+)$)", |
| 1122 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1123 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1124 | if (stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(targetIt), result, regex)) { |
| 1125 | int min{0}, max{0}; |
| 1126 | if (Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(min, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).1]) && |
| 1127 | Utilscxx . . $ Utils/::Stringcxx . . $ Utils/String/::toNumbercxx . . $ Utils/String/toNumber(c75d689ebd728b7b).<int>(max, result[cxx . . $ std/__cxx11/match_results#`operator[]`(f2afb01e2bf6aaf8).2])) |
| 1128 | return stdcxx . . $ std/optional#optional(e3f0d6382bd52f24).::make_paircxx . . $ std/make_pair(1d30b6e115203116).( |
| 1129 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>(min), |
| 1130 | unitscxx . . $ units/::make_unitcxx . . $ units/make_unit(a3cc154fe3bb4ec0).<unitscxx . . $ units/::temperaturecxx . . $ units/temperature/::celsius_tcxx . . $ units/temperature/celsius_t#>(max)); |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 1135 | } |
| 1136 | |
| 1137 | bool isPowerProfileModeDataColumnarcxx . . $ Utils/AMD/isPowerProfileModeDataColumnar(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1138 | { |
| 1139 | if (data.emptycxx . . $ std/vector#empty(3482b152b9333168).()) |
| 1140 | return false; |
| 1141 | |
| 1142 | // The first line of the data contains the profile names and their indices: |
| 1143 | // 0 BOOTUP_DEFAULT* 1 3D_FULL_SCREEN 2 POWER_SAVING 3 VIDEO ... |
| 1144 | auto const &firstLine = data.frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 1145 | |
| 1146 | // Try to match at least two (index power_profile_name) pairs |
| 1147 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const regexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^\s*\d+\s+\w+\s*\*{0,1}\s*\d+\s+\w+\*{0,1})", |
| 1148 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1149 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1150 | return stdcxx . . $ std/::regex_searchcxx . . $ std/regex_search(428e6b8e81328b43).(firstLine, result, regex); |
| 1151 | } |
| 1152 | |
| 1153 | bool hasOverdriveClkVoltControlcxx . . $ Utils/AMD/hasOverdriveClkVoltControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1154 | { |
| 1155 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const clkRegexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^OD_\wCLK:)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1156 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1157 | |
| 1158 | auto clkIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 1159 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1160 | return stdcxx . . $ std/::regex_matchcxx . . $ std/regex_match(428e6b8e81328b43).(line, result, clkRegex); |
| 1161 | }); |
| 1162 | |
| 1163 | if (clkIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt) != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1164 | auto state = parseOverdriveClkVoltLinecxx . . $ Utils/AMD/parseOverdriveClkVoltLine(b5047773ba57749f).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt)); |
| 1165 | return state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).(); |
| 1166 | } |
| 1167 | |
| 1168 | return false; |
| 1169 | } |
| 1170 | |
| 1171 | bool hasOverdriveClkControlcxx . . $ Utils/AMD/hasOverdriveClkControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1172 | { |
| 1173 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const clkRegexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^OD_\wCLK:)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1174 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1175 | |
| 1176 | auto clkIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 1177 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1178 | return stdcxx . . $ std/::regex_matchcxx . . $ std/regex_match(428e6b8e81328b43).(line, result, clkRegex); |
| 1179 | }); |
| 1180 | |
| 1181 | if (clkIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt) != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1182 | auto state = parseOverdriveClksLinecxx . . $ Utils/AMD/parseOverdriveClksLine(818c637c4501e537).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt)); |
| 1183 | return state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).(); |
| 1184 | } |
| 1185 | |
| 1186 | return false; |
| 1187 | } |
| 1188 | |
| 1189 | bool hasOverdriveClkOffsetControlcxx . . $ Utils/AMD/hasOverdriveClkOffsetControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1190 | { |
| 1191 | stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex# const clkRegexcxx . . $ std/__cxx11/basic_regex#basic_regex(d1adbc785ae219ab).(R"(^OD_\wCLK_OFFSET:)", stdcxx . . $ std/::regexcxx . . $ std/__cxx11/regex#::icasecxx . . $ std/__cxx11/basic_regex#icase.); |
| 1192 | stdcxx . . $ std/::smatchcxx . . $ std/__cxx11/smatch# resultcxx . . $ std/__cxx11/match_results#match_results(49f6e7a06ebc5aa8).; |
| 1193 | |
| 1194 | auto clkIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), |
| 1195 | [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1196 | return stdcxx . . $ std/::regex_matchcxx . . $ std/regex_match(428e6b8e81328b43).(line, result, clkRegex); |
| 1197 | }); |
| 1198 | |
| 1199 | if (clkIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt) != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1200 | auto state = parseOverdriveClkOffsetLinecxx . . $ Utils/AMD/parseOverdriveClkOffsetLine(640e463894ae366).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(clkIt)); |
| 1201 | return state.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).(); |
| 1202 | } |
| 1203 | |
| 1204 | return false; |
| 1205 | } |
| 1206 | |
| 1207 | bool hasOverdriveVoltCurveControlcxx . . $ Utils/AMD/hasOverdriveVoltCurveControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1208 | { |
| 1209 | auto curveIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1210 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1211 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_VDDC_CURVE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1212 | }); |
| 1213 | |
| 1214 | if (curveIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).() && stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(curveIt) != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) { |
| 1215 | auto point = parseOverdriveClkVoltLinecxx . . $ Utils/AMD/parseOverdriveClkVoltLine(b5047773ba57749f).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(curveIt)); |
| 1216 | return point.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).(); |
| 1217 | } |
| 1218 | |
| 1219 | return false; |
| 1220 | } |
| 1221 | |
| 1222 | bool hasOverdriveVoltOffsetControlcxx . . $ Utils/AMD/hasOverdriveVoltOffsetControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1223 | { |
| 1224 | auto offsetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1225 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1226 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_VDDGFX_OFFSET:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1227 | }); |
| 1228 | |
| 1229 | return offsetIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(); |
| 1230 | } |
| 1231 | |
| 1232 | bool hasOverdriveFanTargetTempControlcxx . . $ Utils/AMD/hasOverdriveFanTargetTempControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1233 | { |
| 1234 | auto offsetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1235 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1236 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("FAN_TARGET_TEMPERATURE:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1237 | }); |
| 1238 | |
| 1239 | return offsetIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(); |
| 1240 | } |
| 1241 | |
| 1242 | bool hasOverdriveFanMinimumPWMControlcxx . . $ Utils/AMD/hasOverdriveFanMinimumPWMControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1243 | { |
| 1244 | auto offsetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1245 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1246 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("FAN_MINIMUM_PWM:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1247 | }); |
| 1248 | |
| 1249 | return offsetIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(); |
| 1250 | } |
| 1251 | |
| 1252 | bool hasOverdriveFanAcousticTargetControlcxx . . $ Utils/AMD/hasOverdriveFanAcousticTargetControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1253 | { |
| 1254 | auto offsetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1255 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1256 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_ACOUSTIC_TARGET:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1257 | }); |
| 1258 | |
| 1259 | return offsetIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(); |
| 1260 | } |
| 1261 | |
| 1262 | bool hasOverdriveFanAcousticLimitControlcxx . . $ Utils/AMD/hasOverdriveFanAcousticLimitControl(93f8d79ff69eedd8).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &data) |
| 1263 | { |
| 1264 | auto offsetIt = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 1265 | data.cbegincxx . . $ std/vector#cbegin(d1e1699016b9d7e6).(), data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(), [&](stdcxx . . $ std/::stringcxx . . $ std/string# const &line) { |
| 1266 | return line.findcxx . . $ std/__cxx11/basic_string#find(5ed402c22c298042).("OD_ACOUSTIC_LIMIT:") != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.; |
| 1267 | }); |
| 1268 | |
| 1269 | return offsetIt != data.cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).(); |
| 1270 | } |
| 1271 | |
| 1272 | } // namespace Utils::AMD |