| 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 "pmauto.h" |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | #include <string_view> |
| 11 | |
| 12 | namespace AMD { |
| 13 | |
| 14 | class PMAutoLegacy : public AMD::PMAuto |
| 15 | { |
| 16 | static constexpr std::string_view Method{"profile"}; |
| 17 | static constexpr std::string_view Profile{"auto"}; |
| 18 | |
| 19 | public: |
| 20 | PMAutoLegacy( |
| 21 | std::unique_ptr<IDataSource<std::string>> &&powerMethodDataSource, |
| 22 | std::unique_ptr<IDataSource<std::string>> &&powerProfileDataSource) noexcept; |
| 23 | |
| 24 | protected: |
| 25 | void cleanControl(ICommandQueue &ctlCmds) final override; |
| 26 | void syncControl(ICommandQueue &ctlCmds) final override; |
| 27 | |
| 28 | private: |
| 29 | std::unique_ptr<IDataSource<std::string>> const powerMethodDataSource_; |
| 30 | std::unique_ptr<IDataSource<std::string>> const powerProfileDataSource_; |
| 31 | std::string powerMethodEntry_; |
| 32 | std::string powerProfileEntry_; |
| 33 | }; |
| 34 | |
| 35 | } // namespace AMD |