sysclk: fix governor min hz
This commit is contained in:
@@ -451,7 +451,7 @@ static inline uint64_t sysclkDefaultConfigValue(SysClkConfigValue val)
|
|||||||
case HocClkConfigValue_LiteTDPLimit:
|
case HocClkConfigValue_LiteTDPLimit:
|
||||||
return 6400ULL; // 0.5C
|
return 6400ULL; // 0.5C
|
||||||
case HorizonOCConfigValue_CpuGovernorMinimumFreq:
|
case HorizonOCConfigValue_CpuGovernorMinimumFreq:
|
||||||
return 612ULL; // 612MHz
|
return 612000000ULL; // 612MHz
|
||||||
default:
|
default:
|
||||||
return 0ULL;
|
return 0ULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -590,7 +590,28 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void listUI() override {
|
void listUI() override {
|
||||||
this->listElement->addItem(new tsl::elm::CategoryHeader("Governor Settings"));
|
this->listElement->addItem(new tsl::elm::CategoryHeader("Governor Settings"));
|
||||||
addFreqButton(HorizonOCConfigValue_CpuGovernorMinimumFreq, "CPU Governor Minimum Frequency", SysClkModule_CPU, BaseMenuGui::IsMariko() ? cpu_freq_label_m : cpu_freq_label_e);
|
ValueThresholds thresholdsDisabled(0, 0);
|
||||||
|
|
||||||
|
std::vector<NamedValue> GovernorMinHz = {
|
||||||
|
NamedValue("510 MHz", 510000000),
|
||||||
|
NamedValue("612 MHz", 612000000),
|
||||||
|
NamedValue("714 MHz", 714000000),
|
||||||
|
NamedValue("816 MHz", 816000000),
|
||||||
|
NamedValue("918 MHz", 918000000),
|
||||||
|
NamedValue("1020 MHz", 1020000000),
|
||||||
|
};
|
||||||
|
|
||||||
|
addConfigButton(
|
||||||
|
HorizonOCConfigValue_CpuGovernorMinimumFreq,
|
||||||
|
"CPU Governor Minimum Frequency",
|
||||||
|
ValueRange(0, 0, 1, "", 0),
|
||||||
|
"CPU Governor Minimum Frequency",
|
||||||
|
&thresholdsDisabled,
|
||||||
|
{},
|
||||||
|
GovernorMinHz,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ u32 initialConfigValues[SysClkConfigValue_EnumMax]; // initial config. used for
|
|||||||
bool kipAvailable = false;
|
bool kipAvailable = false;
|
||||||
bool isCpuGovernorInBoostMode = false;
|
bool isCpuGovernorInBoostMode = false;
|
||||||
bool isVRREnabled = false;
|
bool isVRREnabled = false;
|
||||||
|
|
||||||
ClockManager *ClockManager::GetInstance()
|
ClockManager *ClockManager::GetInstance()
|
||||||
{
|
{
|
||||||
return instance;
|
return instance;
|
||||||
@@ -370,7 +371,8 @@ void ClockManager::CpuGovernorThread(void* arg) {
|
|||||||
|
|
||||||
u32 downHoldRemaining = 0;
|
u32 downHoldRemaining = 0;
|
||||||
u32 lastHz = 0;
|
u32 lastHz = 0;
|
||||||
|
u32 minHz = 612;
|
||||||
|
u32 tick = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!mgr->running || !isCpuGovernorEnabled) {
|
if (!mgr->running || !isCpuGovernorEnabled) {
|
||||||
downHoldRemaining = 0;
|
downHoldRemaining = 0;
|
||||||
@@ -424,6 +426,14 @@ void ClockManager::CpuGovernorThread(void* arg) {
|
|||||||
if (downHoldRemaining > 0)
|
if (downHoldRemaining > 0)
|
||||||
downHoldRemaining--;
|
downHoldRemaining--;
|
||||||
|
|
||||||
|
if(++tick > 50) {
|
||||||
|
minHz = mgr->config->GetConfigValue(HorizonOCConfigValue_CpuGovernorMinimumFreq);
|
||||||
|
tick = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newHz < minHz)
|
||||||
|
newHz = minHz;
|
||||||
|
|
||||||
if ((!goingDown || (downHoldRemaining == 0)) && mgr->IsAssignableHz(SysClkModule_CPU, newHz)) {
|
if ((!goingDown || (downHoldRemaining == 0)) && mgr->IsAssignableHz(SysClkModule_CPU, newHz)) {
|
||||||
Board::SetHz(SysClkModule_CPU, newHz);
|
Board::SetHz(SysClkModule_CPU, newHz);
|
||||||
mgr->context->freqs[SysClkModule_CPU] = newHz;
|
mgr->context->freqs[SysClkModule_CPU] = newHz;
|
||||||
|
|||||||
Reference in New Issue
Block a user