| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "core/idatasource.h" |
| 7 | #include "pmfixed.h" |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | #include <string_view> |
| 11 | #include <vector> |
| 12 | |
| 13 | namespace AMD { |
| 14 | |
| 15 | class PMFixedLegacy : public PMFixed |
| 16 | { |
| 17 | static constexpr std::string_view Method{"profile"}; |
| 18 | struct Profile |
| 19 | { |
| 20 | static constexpr std::string_view low{"low"}; |
| 21 | static constexpr std::string_view mid{"mid"}; |
| 22 | static constexpr std::string_view high{"high"}; |
| 23 | static constexpr std::string_view clean{"auto"}; |
| 24 | }; |
| 25 | |
| 26 | public: |
| 27 | PMFixedLegacy( |
| 28 | std::unique_ptr<IDataSource<std::string>> &&powerMethodDataSource, |
| 29 | std::unique_ptr<IDataSource<std::string>> &&powerProfileDataSource) noexcept; |
| 30 | |
| 31 | protected: |
| 32 | void cleanControl(ICommandQueue &ctlCmds) final override; |
| 33 | void syncControl(ICommandQueue &ctlCmds) final override; |
| 34 | |
| 35 | std::vector<std::string> const &modes() const final override; |
| 36 | |
| 37 | private: |
| 38 | std::unique_ptr<IDataSource<std::string>> const powerMethodDataSource_; |
| 39 | std::unique_ptr<IDataSource<std::string>> const powerProfileDataSource_; |
| 40 | std::string powerMethodEntry_; |
| 41 | std::string powerProfileEntry_; |
| 42 | |
| 43 | static std::vector<std::string> const modes_; |
| 44 | }; |
| 45 | |
| 46 | } // namespace AMD |