hocclk: minor refactor
This commit is contained in:
@@ -73,6 +73,6 @@ typedef struct
|
|||||||
|
|
||||||
#define HOCCLK_FREQ_LIST_MAX 32
|
#define HOCCLK_FREQ_LIST_MAX 32
|
||||||
|
|
||||||
#define GLOBAL_PROFILE_ID 0xA111111111111111
|
#define HOCCLK_GLOBAL_PROFILE_TID 0xA111111111111111
|
||||||
|
|
||||||
static_assert(sizeof(HocClkContext) == 0x500);
|
static_assert(sizeof(HocClkContext) == 0x500);
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
#include "base_menu_gui.h"
|
#include "base_menu_gui.h"
|
||||||
#include "freq_choice_gui.h"
|
#include "freq_choice_gui.h"
|
||||||
#include "value_choice_gui.h"
|
#include "value_choice_gui.h"
|
||||||
#define HOCCLK_GLOBAL_PROFILE_TID 0xA111111111111111
|
|
||||||
class AppProfileGui : public BaseMenuGui
|
class AppProfileGui : public BaseMenuGui
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ namespace clockManager {
|
|||||||
if (!targetHz) {
|
if (!targetHz) {
|
||||||
targetHz = config::GetAutoClockHz(gContext.applicationId, HocClkModule_GPU, gContext.profile, false);
|
targetHz = config::GetAutoClockHz(gContext.applicationId, HocClkModule_GPU, gContext.profile, false);
|
||||||
if (!targetHz) {
|
if (!targetHz) {
|
||||||
targetHz = config::GetAutoClockHz(GLOBAL_PROFILE_ID, HocClkModule_GPU, gContext.profile, false);
|
targetHz = config::GetAutoClockHz(HOCCLK_GLOBAL_PROFILE_TID, HocClkModule_GPU, gContext.profile, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
u32 maxHz = GetMaxAllowedHz(HocClkModule_GPU, gContext.profile);
|
u32 maxHz = GetMaxAllowedHz(HocClkModule_GPU, gContext.profile);
|
||||||
@@ -357,7 +357,7 @@ namespace clockManager {
|
|||||||
if (!targetHz) {
|
if (!targetHz) {
|
||||||
targetHz = config::GetAutoClockHz(gContext.applicationId, (HocClkModule)module, gContext.profile, returnRaw);
|
targetHz = config::GetAutoClockHz(gContext.applicationId, (HocClkModule)module, gContext.profile, returnRaw);
|
||||||
if (!targetHz)
|
if (!targetHz)
|
||||||
targetHz = config::GetAutoClockHz(GLOBAL_PROFILE_ID, (HocClkModule)module, gContext.profile, returnRaw);
|
targetHz = config::GetAutoClockHz(HOCCLK_GLOBAL_PROFILE_TID, (HocClkModule)module, gContext.profile, returnRaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module == HocClkModule_Governor) {
|
if (module == HocClkModule_Governor) {
|
||||||
@@ -528,7 +528,7 @@ namespace clockManager {
|
|||||||
if (!targetHz) {
|
if (!targetHz) {
|
||||||
targetHz = config::GetAutoClockHz(gContext.applicationId, HocClkModule_Display, gContext.profile, true);
|
targetHz = config::GetAutoClockHz(gContext.applicationId, HocClkModule_Display, gContext.profile, true);
|
||||||
if (!targetHz)
|
if (!targetHz)
|
||||||
targetHz = config::GetAutoClockHz(GLOBAL_PROFILE_ID, HocClkModule_Display, gContext.profile, true);
|
targetHz = config::GetAutoClockHz(HOCCLK_GLOBAL_PROFILE_TID, HocClkModule_Display, gContext.profile, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (board::GetConsoleType() != HocClkConsoleType_Hoag)
|
if (board::GetConsoleType() != HocClkConsoleType_Hoag)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "governor.hpp"
|
#include "governor.hpp"
|
||||||
#include "process_management.hpp"
|
#include "process_management.hpp"
|
||||||
|
#include <hocclk/clock_manager.h>
|
||||||
namespace governor {
|
namespace governor {
|
||||||
|
|
||||||
#define POLL_NS 5'000'000 // 5 ms – governor poll rate
|
#define POLL_NS 5'000'000 // 5 ms – governor poll rate
|
||||||
@@ -43,7 +44,7 @@ namespace governor {
|
|||||||
if (!tempTargetHz) {
|
if (!tempTargetHz) {
|
||||||
tempTargetHz = config::GetAutoClockHz(clockManager::gContext.applicationId, HocClkModule_Governor, clockManager::gContext.profile, true);
|
tempTargetHz = config::GetAutoClockHz(clockManager::gContext.applicationId, HocClkModule_Governor, clockManager::gContext.profile, true);
|
||||||
if (!tempTargetHz)
|
if (!tempTargetHz)
|
||||||
tempTargetHz = config::GetAutoClockHz(GLOBAL_PROFILE_ID, HocClkModule_Governor, clockManager::gContext.profile, true);
|
tempTargetHz = config::GetAutoClockHz(HOCCLK_GLOBAL_PROFILE_TID, HocClkModule_Governor, clockManager::gContext.profile, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto resolve = [](u8 app, u8 temp) -> u8 {
|
auto resolve = [](u8 app, u8 temp) -> u8 {
|
||||||
@@ -107,7 +108,7 @@ namespace governor {
|
|||||||
clockManager::gContext.profile, false);
|
clockManager::gContext.profile, false);
|
||||||
if (!hz)
|
if (!hz)
|
||||||
hz = config::GetAutoClockHz(
|
hz = config::GetAutoClockHz(
|
||||||
GLOBAL_PROFILE_ID, module,
|
HOCCLK_GLOBAL_PROFILE_TID, module,
|
||||||
clockManager::gContext.profile, false);
|
clockManager::gContext.profile, false);
|
||||||
return hz;
|
return hz;
|
||||||
}
|
}
|
||||||
@@ -295,7 +296,7 @@ namespace governor {
|
|||||||
if (!targetHz) {
|
if (!targetHz) {
|
||||||
targetHz = config::GetAutoClockHz(clockManager::gContext.applicationId, HocClkModule_Display, clockManager::gContext.profile, false);
|
targetHz = config::GetAutoClockHz(clockManager::gContext.applicationId, HocClkModule_Display, clockManager::gContext.profile, false);
|
||||||
if (!targetHz)
|
if (!targetHz)
|
||||||
targetHz = config::GetAutoClockHz(GLOBAL_PROFILE_ID, HocClkModule_Display, clockManager::gContext.profile, false);
|
targetHz = config::GetAutoClockHz(HOCCLK_GLOBAL_PROFILE_TID, HocClkModule_Display, clockManager::gContext.profile, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 maxDisplay;
|
u8 maxDisplay;
|
||||||
|
|||||||
Reference in New Issue
Block a user