| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/info/amd/gpuinfoodfanctrl.cpp`/ |
| 2 | // Copyright 2023 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "gpuinfoodfanctrl.h"cxx . . $ `<file>/src/core/info/amd/gpuinfoodfanctrl.h`/ |
| 5 | |
| 6 | #include "common/fileutils.h"cxx . . $ `<file>/src/common/fileutils.h`/ |
| 7 | #include "core/info/infoproviderregistry.h"cxx . . $ `<file>/src/core/info/infoproviderregistry.h`/ |
| 8 | #include <exception> |
| 9 | #include <filesystem> |
| 10 | #include <memory> |
| 11 | #include <spdlog/spdlog.h> |
| 12 | |
| 13 | AMDcxx . . $ AMD/::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#GPUInfoOdFanCtrl(ced63f7c635d850d).() noexcept |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, stdcxx . . $ std/::stringcxx . . $ std/string#>> |
| 18 | AMDcxx . . $ AMD/::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#::provideInfocxx . . $ AMD/GPUInfoOdFanCtrl#provideInfo(5b65f7e996e13d80).(Vendorcxx . . $ Vendor#, int, IGPUInfocxx . . $ IGPUInfo#::Pathcxx . . $ IGPUInfo#Path# const &, |
| 19 | IHWIDTranslatorcxx . . $ IHWIDTranslator# const &) const |
| 20 | { |
| 21 | return {cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}; |
| 22 | } |
| 23 | |
| 24 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> |
| 25 | AMDcxx . . $ AMD/::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#::provideCapabilitiescxx . . $ AMD/GPUInfoOdFanCtrl#provideCapabilities(da28437f5803dad2).(Vendorcxx . . $ Vendor# vendor, int, |
| 26 | IGPUInfocxx . . $ IGPUInfo#::Pathcxx . . $ IGPUInfo#Path# const &path) const |
| 27 | { |
| 28 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> capcxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 29 | |
| 30 | if (vendor == Vendorcxx . . $ Vendor#::AMDcxx . . $ Vendor#AMD.) { |
| 31 | auto fanCtlPath = path.syscxx . . $ IGPUInfo#Path#sys. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "gpu_od"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "fan_ctrl"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 32 | try { |
| 33 | if (Utilscxx . . $ Utils/::Filecxx . . $ Utils/File/::isDirectoryPathValidcxx . . $ Utils/File/isDirectoryPathValid(c53a6ef3278968b1).(fanCtlPath) && |
| 34 | !stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::is_emptycxx . . $ std/filesystem/is_empty(c53a6ef3278968b1).(fanCtlPath)) { |
| 35 | cap.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#::IDcxx . . $ AMD/GPUInfoOdFanCtrl#ID.); |
| 36 | } |
| 37 | } |
| 38 | catch (stdcxx . . $ std/::exception const &e) { |
| 39 | SPDLOG_DEBUGcxx . . $ `<external>/13613935168682455490/spdlog.h:311:13`!(e.what()); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | return capcxx . . $ std/vector#vector(6f559d22b039ccdb).; |
| 44 | } |
| 45 | |
| 46 | bool AMDcxx . . $ AMD/::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#::registered_cxx . . $ AMD/GPUInfoOdFanCtrl#registered_. = |
| 47 | InfoProviderRegistrycxx . . $ InfoProviderRegistry#::addcxx . . $ InfoProviderRegistry#add(2c04d579dc484cde).(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<AMDcxx . . $ AMD/::GPUInfoOdFanCtrlcxx . . $ AMD/GPUInfoOdFanCtrl#>()); |