| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "../igpuinfo.h" |
| 7 | #include "core/idatasource.h" |
| 8 | #include <filesystem> |
| 9 | #include <memory> |
| 10 | #include <string> |
| 11 | #include <string_view> |
| 12 | #include <vector> |
| 13 | |
| 14 | namespace AMD { |
| 15 | |
| 16 | /// AMD Power management GPU info |
| 17 | class GPUInfoPM final : public IGPUInfo::IProvider |
| 18 | { |
| 19 | public: |
| 20 | static constexpr std::string_view Legacy{"pmlegacy"}; |
| 21 | static constexpr std::string_view Radeon{"pmradeon"}; |
| 22 | static constexpr std::string_view Amdgpu{"pmamdgpu"}; |
| 23 | |
| 24 | GPUInfoPM(std::vector< |
| 25 | std::shared_ptr<IDataSource<std::string, std::filesystem::path const>>> |
| 26 | &&dataSources) noexcept; |
| 27 | |
| 28 | std::vector<std::pair<std::string, std::string>> |
| 29 | provideInfo(Vendor vendor, int gpuIndex, IGPUInfo::Path const &path, |
| 30 | IHWIDTranslator const &hwIDTranslator) const override; |
| 31 | |
| 32 | std::vector<std::string> |
| 33 | provideCapabilities(Vendor vendor, int gpuIndex, |
| 34 | IGPUInfo::Path const &path) const override; |
| 35 | |
| 36 | private: |
| 37 | std::vector<std::shared_ptr<IDataSource<std::string, std::filesystem::path const>>> const |
| 38 | dataSources_; |
| 39 | static bool registered_; |
| 40 | }; |
| 41 | |
| 42 | } // namespace AMD |