sysclk: add sys-dock intergration
This commit is contained in:
@@ -43,10 +43,12 @@ typedef struct
|
|||||||
uint32_t voltages[HocClkVoltage_EnumMax];
|
uint32_t voltages[HocClkVoltage_EnumMax];
|
||||||
u16 speedos[HorizonOCSpeedo_EnumMax];
|
u16 speedos[HorizonOCSpeedo_EnumMax];
|
||||||
u16 iddq[HorizonOCSpeedo_EnumMax];
|
u16 iddq[HorizonOCSpeedo_EnumMax];
|
||||||
|
GpuSchedulingMode gpuSchedulingMode;
|
||||||
|
bool isSysDockInstalled;
|
||||||
u8 maxDisplayFreq;
|
u8 maxDisplayFreq;
|
||||||
u8 fps;
|
|
||||||
u8 dramID;
|
u8 dramID;
|
||||||
bool isDram8GB;
|
bool isDram8GB;
|
||||||
|
u8 fps;
|
||||||
} SysClkContext;
|
} SysClkContext;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ static bool g_canChangeRefreshRateDocked = false;
|
|||||||
static uint8_t g_lastVActiveSet = 0;
|
static uint8_t g_lastVActiveSet = 0;
|
||||||
|
|
||||||
// Refresh rate tables
|
// Refresh rate tables
|
||||||
static const uint8_t g_dockedRefreshRates[] = {40, 45, 50, 55, 60, 70, 72, 75, 80, 90, 95, 100, 110, 120};
|
static const uint8_t g_dockedRefreshRates[] = {40, 45, 50, 55, 60, 70, 72, 75, 80, 90, 95, 100, 110, 120, 130, 144, 150, 160, 165, 170, 180, 190, 200, 210, 220, 230, 240};
|
||||||
static bool g_dockedAllowed[14] = {0};
|
static bool g_dockedAllowed[sizeof(g_dockedRefreshRates) / sizeof(g_dockedRefreshRates[0])] = {0};
|
||||||
static bool g_dockedAllowed720p[14] = {0};
|
static bool g_dockedAllowed720p[sizeof(g_dockedRefreshRates) / sizeof(g_dockedRefreshRates[0])] = {0};
|
||||||
|
|
||||||
static const DockedTimings g_dockedTimings1080p[] = {
|
static const DockedTimings g_dockedTimings1080p[] = {
|
||||||
{8, 32, 40, 7, 8, 6, 0, 88080}, // 40Hz
|
{8, 32, 40, 7, 8, 6, 0, 88080}, // 40Hz
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
tsl::elm::ListItem* SpeedoItem = NULL;
|
tsl::elm::ListItem* SpeedoItem = NULL;
|
||||||
tsl::elm::ListItem* IddqItem = NULL;
|
tsl::elm::ListItem* IddqItem = NULL;
|
||||||
|
tsl::elm::ListItem* sysdockStatusItem = NULL;
|
||||||
ImageElement* CatImage = NULL;
|
ImageElement* CatImage = NULL;
|
||||||
HideableCategoryHeader* CatHeader = NULL;
|
HideableCategoryHeader* CatHeader = NULL;
|
||||||
HideableCustomDrawer* CatSpacer = NULL;
|
HideableCustomDrawer* CatSpacer = NULL;
|
||||||
@@ -41,17 +42,21 @@ AboutGui::~AboutGui()
|
|||||||
void AboutGui::listUI()
|
void AboutGui::listUI()
|
||||||
{
|
{
|
||||||
this->listElement->addItem(
|
this->listElement->addItem(
|
||||||
new tsl::elm::CategoryHeader("Speedo/IDDQ")
|
new tsl::elm::CategoryHeader("Information")
|
||||||
);
|
);
|
||||||
|
|
||||||
SpeedoItem =
|
SpeedoItem =
|
||||||
new tsl::elm::ListItem("Speedos:");
|
new tsl::elm::ListItem("Speedo:");
|
||||||
this->listElement->addItem(SpeedoItem);
|
this->listElement->addItem(SpeedoItem);
|
||||||
|
|
||||||
IddqItem =
|
IddqItem =
|
||||||
new tsl::elm::ListItem("IDDQ:");
|
new tsl::elm::ListItem("IDDQ:");
|
||||||
this->listElement->addItem(IddqItem);
|
this->listElement->addItem(IddqItem);
|
||||||
|
|
||||||
|
sysdockStatusItem =
|
||||||
|
new tsl::elm::ListItem("sys-dock status:");
|
||||||
|
this->listElement->addItem(sysdockStatusItem);
|
||||||
|
|
||||||
this->listElement->addItem(
|
this->listElement->addItem(
|
||||||
new tsl::elm::CategoryHeader("Credits")
|
new tsl::elm::CategoryHeader("Credits")
|
||||||
);
|
);
|
||||||
@@ -221,4 +226,5 @@ void AboutGui::refresh()
|
|||||||
sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]);
|
sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]);
|
||||||
SpeedoItem->setValue(strings[0]);
|
SpeedoItem->setValue(strings[0]);
|
||||||
IddqItem->setValue(strings[1]);
|
IddqItem->setValue(strings[1]);
|
||||||
|
sysdockStatusItem->setValue(this->context->isSysDockInstalled ? "Installed" : "Not Installed");
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,10 @@ void AppProfileGui::addModuleListItemValue(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AppProfileGui::addProfileUI(SysClkProfile profile)
|
void AppProfileGui::addProfileUI(SysClkProfile profile)
|
||||||
{
|
{
|
||||||
|
BaseMenuGui::refresh();
|
||||||
|
if(!this->context)
|
||||||
|
return;
|
||||||
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
|
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
|
||||||
if (R_FAILED(rc)) [[unlikely]] {
|
if (R_FAILED(rc)) [[unlikely]] {
|
||||||
FatalGui::openWithResultCode("sysclkIpcGetConfigValues", rc);
|
FatalGui::openWithResultCode("sysclkIpcGetConfigValues", rc);
|
||||||
@@ -291,7 +294,7 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
|
|||||||
if(profile != SysClkProfile_Docked)
|
if(profile != SysClkProfile_Docked)
|
||||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", IsAula() ? 45 : 40, configList.values[HorizonOCConfigValue_EnableUnsafeDisplayFreqs] ? IsAula() ? 65 : 72 : 60, 1, " Hz", 1, 0, lcdThresholds);
|
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", IsAula() ? 45 : 40, configList.values[HorizonOCConfigValue_EnableUnsafeDisplayFreqs] ? IsAula() ? 65 : 72 : 60, 1, " Hz", 1, 0, lcdThresholds);
|
||||||
else
|
else
|
||||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 5, " Hz", 1, 0);
|
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, IsAula() ? this->context->isSysDockInstalled ? 120 : 75 : 120, 5, " Hz", 1, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
this->addModuleListItemToggle(profile, HorizonOCModule_Governor);
|
this->addModuleListItemToggle(profile, HorizonOCModule_Governor);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <crc32.h>
|
#include <crc32.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#define HOSPPC_HAS_BOOST (hosversionAtLeast(7,0,0))
|
#define HOSPPC_HAS_BOOST (hosversionAtLeast(7,0,0))
|
||||||
bool isGovernorEnabled = false; // to avoid thread messes
|
bool isGovernorEnabled = false; // to avoid thread messes
|
||||||
@@ -113,6 +114,14 @@ ClockManager::ClockManager()
|
|||||||
this->context->isDram8GB = Board::IsDram8GB();
|
this->context->isDram8GB = Board::IsDram8GB();
|
||||||
previousRamHz = Board::GetHz(SysClkModule_MEM);
|
previousRamHz = Board::GetHz(SysClkModule_MEM);
|
||||||
Board::SetGpuSchedulingMode((GpuSchedulingMode)this->config->GetConfigValue(HorizonOCConfigValue_GPUScheduling));
|
Board::SetGpuSchedulingMode((GpuSchedulingMode)this->config->GetConfigValue(HorizonOCConfigValue_GPUScheduling));
|
||||||
|
this->context->gpuSchedulingMode = (GpuSchedulingMode)this->config->GetConfigValue(HorizonOCConfigValue_GPUScheduling);
|
||||||
|
|
||||||
|
struct stat st = {0};
|
||||||
|
if (stat("sdmc:/atmosphere/contents/42000000000000A0", &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||||
|
this->context->isSysDockInstalled = true;
|
||||||
|
} else {
|
||||||
|
this->context->isSysDockInstalled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClockManager::~ClockManager()
|
ClockManager::~ClockManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user