Sys-clk-OC: Fixed #41; Erista support added; Manager is deprecated
This commit is contained in:
@@ -58,7 +58,6 @@ ClockManager::ClockManager()
|
||||
|
||||
this->oc = new SysClkOcExtra;
|
||||
this->oc->systemCoreBoostCPU = false;
|
||||
this->oc->allowUnsafeFreq = false;
|
||||
this->oc->governor = false;
|
||||
this->oc->realProfile = SysClkProfile_Handheld;
|
||||
this->oc->maxMEMFreq = 0;
|
||||
@@ -138,7 +137,7 @@ uint32_t ClockManager::GetHz(SysClkModule module)
|
||||
if (hz)
|
||||
{
|
||||
/* Considering realProfile frequency limit */
|
||||
hz = Clocks::GetNearestHz(module, this->oc->realProfile, hz, this->oc->allowUnsafeFreq);
|
||||
hz = Clocks::GetNearestHz(module, this->oc->realProfile, hz);
|
||||
|
||||
if (module == SysClkModule_MEM && hz == MAX_MEM_CLOCK)
|
||||
{
|
||||
@@ -244,7 +243,8 @@ bool ClockManager::RefreshContext()
|
||||
bool hasChanged = this->config->Refresh();
|
||||
if (hasChanged) {
|
||||
this->rnxSync->ToggleSync(this->GetConfig()->GetConfigValue(SysClkConfigValue_SyncReverseNXMode));
|
||||
this->oc->allowUnsafeFreq = this->GetConfig()->GetConfigValue(SysClkConfigValue_AllowUnsafeFrequencies);
|
||||
bool allowUnsafe = this->GetConfig()->GetConfigValue(SysClkConfigValue_AllowUnsafeFrequencies);
|
||||
Clocks::SetAllowUnsafe(allowUnsafe);
|
||||
}
|
||||
|
||||
bool enabled = this->GetConfig()->Enabled();
|
||||
@@ -255,14 +255,6 @@ bool ClockManager::RefreshContext()
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
bool governor = this->GetConfig()->GetConfigValue(SysClkConfigValue_GovernorExperimental);
|
||||
if (governor != this->oc->governor)
|
||||
{
|
||||
this->oc->governor = governor;
|
||||
FileUtils::LogLine("[mgr] Governor status: %s", governor ? "enabled" : "disabled");
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
std::uint64_t applicationId = ProcessManagement::GetCurrentApplicationId();
|
||||
if (applicationId != this->context->applicationId)
|
||||
{
|
||||
@@ -274,8 +266,17 @@ bool ClockManager::RefreshContext()
|
||||
this->rnxSync->Reset(applicationId);
|
||||
}
|
||||
|
||||
bool governor = this->GetConfig()->GetConfigValue(SysClkConfigValue_GovernorExperimental);
|
||||
governor &= !this->GetConfig()->GetTitleGovernorDisabled(applicationId);
|
||||
if (governor != this->oc->governor)
|
||||
{
|
||||
this->oc->governor = governor;
|
||||
FileUtils::LogLine("[mgr] Governor status: %s", governor ? "enabled" : "disabled");
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
if (hasChanged) {
|
||||
if (enabled && governor && !this->GetConfig()->GetTitleGovernorDisabled(applicationId))
|
||||
if (enabled && governor)
|
||||
this->governor->Start();
|
||||
else
|
||||
this->governor->Stop();
|
||||
|
||||
Reference in New Issue
Block a user