sysclk: fully fix dvfs
This commit is contained in:
@@ -1,3 +1,27 @@
|
|||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 Roy Merkel
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef MEMMEM_IMPL_H
|
#ifndef MEMMEM_IMPL_H
|
||||||
#define MEMMEM_IMPL_H
|
#define MEMMEM_IMPL_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 Roy Merkel
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "memmem.h"
|
#include "memmem.h"
|
||||||
|
|
||||||
void *memmem_impl(void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
|
void *memmem_impl(void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ void FreqChoiceGui::listUI()
|
|||||||
|
|
||||||
if (IsMariko())
|
if (IsMariko())
|
||||||
{
|
{
|
||||||
unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2296 : 1963;
|
unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2296 : 1964;
|
||||||
if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) {
|
if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) {
|
||||||
unsafe_gpu = 1076;
|
unsafe_gpu = 1076;
|
||||||
} else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) {
|
} else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) {
|
||||||
|
|||||||
@@ -578,7 +578,6 @@ void ClockManager::Tick()
|
|||||||
|
|
||||||
if(module == SysClkModule_MEM && Board::GetSocType() == SysClkSocType_Mariko && targetHz < oldHz && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) {
|
if(module == SysClkModule_MEM && Board::GetSocType() == SysClkSocType_Mariko && targetHz < oldHz && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) {
|
||||||
Board::PcvHijackDvfs(0);
|
Board::PcvHijackDvfs(0);
|
||||||
// I2c_BuckConverter_SetMvOut(&I2c_Mariko_GPU, 0);
|
|
||||||
|
|
||||||
targetHz = this->context->overrideFreqs[SysClkModule_GPU];
|
targetHz = this->context->overrideFreqs[SysClkModule_GPU];
|
||||||
if (!targetHz)
|
if (!targetHz)
|
||||||
@@ -691,6 +690,21 @@ bool ClockManager::RefreshContext()
|
|||||||
|
|
||||||
if (Board::GetSocType() == SysClkSocType_Mariko && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) {
|
if (Board::GetSocType() == SysClkSocType_Mariko && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) {
|
||||||
Board::PcvHijackDvfs(0);
|
Board::PcvHijackDvfs(0);
|
||||||
|
|
||||||
|
u32 targetHz = this->context->overrideFreqs[SysClkModule_GPU];
|
||||||
|
if (!targetHz)
|
||||||
|
{
|
||||||
|
targetHz = this->config->GetAutoClockHz(this->context->applicationId, SysClkModule_GPU, this->context->profile, false);
|
||||||
|
if(!targetHz)
|
||||||
|
targetHz = this->config->GetAutoClockHz(GLOBAL_PROFILE_ID, SysClkModule_GPU, this->context->profile, false);
|
||||||
|
}
|
||||||
|
if(targetHz) {
|
||||||
|
Board::SetHz(SysClkModule_GPU, ~0);
|
||||||
|
Board::SetHz(SysClkModule_GPU, targetHz);
|
||||||
|
} else {
|
||||||
|
Board::SetHz(SysClkModule_GPU, ~0);
|
||||||
|
Board::ResetToStockGpu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user