This commit is contained in:
hanai3Bi
2023-04-01 01:49:31 +03:00
committed by hanabbi
parent 63bbde2f58
commit 3db0b9b380
210 changed files with 1286 additions and 48394 deletions

View File

@@ -81,8 +81,8 @@ namespace GovernorImpl {
class BaseGovernor {
public:
BaseGovernor(SysClkModule module) : m_module(module) {
m_hz_list = GetModuleFreqTable(module);
m_ref_hz = GetModuleMaximumFreq(module);
m_hz_list = Clocks::freqTable[module].freq;
m_ref_hz = *Clocks::freqRange[module].last;
};
uint32_t RefreshContext() { return this->m_target_hz = Clocks::GetCurrentHz(this->m_module); };
@@ -104,12 +104,6 @@ namespace GovernorImpl {
Clocks::SetHz(m_module, hz);
};
void ApplyBoost() {
ApplyTargetFreq(
(m_module == SysClkModule_CPU && max_hz > boost_hz) ? max_hz : boost_hz
);
};
SysClkModule m_module;
uint32_t* m_hz_list;
uint32_t m_target_hz, m_ref_hz;
@@ -129,6 +123,10 @@ namespace GovernorImpl {
void Apply();
void ApplyBoost() {
ApplyTargetFreq((max_hz > boost_hz) ? max_hz : boost_hz);
};
bool auto_boost;
protected:
@@ -204,7 +202,9 @@ namespace GovernorImpl {
nvExit();
};
void SetMaxHz(uint32_t maxHz);
void ApplyBoost() {
ApplyTargetFreq(boost_hz);
};
void Apply();
@@ -317,7 +317,7 @@ namespace GovernorImpl {
class Governor {
public:
Governor() {
Governor() {
m_cpu_gov = new GovernorImpl::CpuGovernor(this);
m_gpu_gov = new GovernorImpl::GpuGovernor();
};