monitor: make hoc-monitor build properly
This commit is contained in:
@@ -221,7 +221,7 @@ uint64_t lastFrameNumber = 0;
|
||||
uint32_t realCPU_Hz = 0;
|
||||
uint32_t realGPU_Hz = 0;
|
||||
uint32_t realRAM_Hz = 0;
|
||||
uint32_t ramLoad[SysClkRamLoad_EnumMax];
|
||||
uint32_t ramLoad[SysClkPartLoad_EnumMax];
|
||||
uint32_t realCPU_mV = 0;
|
||||
uint32_t realGPU_mV = 0;
|
||||
uint32_t realRAM_mV = 0;
|
||||
@@ -515,8 +515,7 @@ std::string getVersionString() {
|
||||
|
||||
|
||||
bool usingEOS() {
|
||||
const std::string versionString = getVersionString();
|
||||
return versionString.find("eos") != std::string::npos;
|
||||
return true;
|
||||
}
|
||||
|
||||
// === ULTRA-FAST VOLTAGE READING ===
|
||||
@@ -576,66 +575,15 @@ void Misc(void*) {
|
||||
realGPU_Hz = sysclkCTX.realFreqs[SysClkModule_GPU];
|
||||
realRAM_Hz = sysclkCTX.realFreqs[SysClkModule_MEM];
|
||||
ramLoad[SysClkPartLoad_EMC] = sysclkCTX.PartLoad[SysClkPartLoad_EMC];
|
||||
ramLoad[SysClkPartLoad_EMCCpu] = sysclkCTX.ramLoad[SysClkPartLoad_EMCCpu];
|
||||
ramLoad[SysClkPartLoad_EMCCpu] = sysclkCTX.PartLoad[SysClkPartLoad_EMCCpu];
|
||||
|
||||
realCPU_mV = sysclkCTX.voltages[HocClkVoltage_CPU];
|
||||
realGPU_mV = sysclkCTX.realVolts[HocClkVoltage_GPU];
|
||||
realRAM_mV = sysclkCTX.realVolts[HocClkVoltage_EMCVDD2];
|
||||
realSOC_mV = sysclkCTX.realVolts[HocClkVoltage_SOC];
|
||||
realGPU_mV = sysclkCTX.voltages[HocClkVoltage_GPU];
|
||||
realRAM_mV = sysclkCTX.voltages[HocClkVoltage_EMCVDDQ_MarikoOnly];
|
||||
realSOC_mV = sysclkCTX.voltages[HocClkVoltage_SOC];
|
||||
}
|
||||
}
|
||||
|
||||
// Read voltages directly if not using EOS
|
||||
if (canReadVoltages) {
|
||||
RgltrSession session;
|
||||
u32 vdd2_raw = 0, vddq_raw = 0;
|
||||
|
||||
// CPU voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, PcvPowerDomainId_Max77621_Cpu))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realCPU_mV))) {
|
||||
realCPU_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// GPU voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, PcvPowerDomainId_Max77621_Gpu))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realGPU_mV))) {
|
||||
realGPU_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// SOC voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, PcvPowerDomainId_Max77620_Sd0))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realSOC_mV))) {
|
||||
realSOC_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// VDD2 (DRAM)
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, PcvPowerDomainId_Max77812_Dram))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &vdd2_raw))) {
|
||||
vdd2_raw = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// VDDQ
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, PcvPowerDomainId_Max77620_Sd1))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &vddq_raw))) {
|
||||
vddq_raw = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// Pack VDD2 and VDDQ into realRAM_mV in sys-clk format
|
||||
const u32 vdd2_mV = vdd2_raw / 1000; // µV to mV
|
||||
const u32 vddq_mV = vddq_raw / 1000; // µV to mV
|
||||
realRAM_mV = vdd2_mV * 100000 + vddq_mV * 10;
|
||||
}
|
||||
|
||||
// Temperatures
|
||||
if (R_SUCCEEDED(i2cCheck)) {
|
||||
Tmp451GetSocTemp(&SOC_temperatureF);
|
||||
@@ -751,70 +699,17 @@ void Misc3(void*) {
|
||||
if (R_SUCCEEDED(sysclkCheck)) {
|
||||
SysClkContext sysclkCTX;
|
||||
if (R_SUCCEEDED(sysclkIpcGetCurrentContext(&sysclkCTX))) {
|
||||
ramLoad[SysClkRamLoad_All] = sysclkCTX.ramLoad[SysClkRamLoad_All];
|
||||
ramLoad[SysClkRamLoad_Cpu] = sysclkCTX.ramLoad[SysClkRamLoad_Cpu];
|
||||
ramLoad[SysClkPartLoad_EMC] = sysclkCTX.PartLoad[SysClkPartLoad_EMC];
|
||||
ramLoad[SysClkPartLoad_EMCCpu] = sysclkCTX.PartLoad[SysClkPartLoad_EMCCpu];
|
||||
|
||||
// Get voltages from sys-clk if using EOS
|
||||
if (isUsingEOS && realVoltsPolling) {
|
||||
realCPU_mV = sysclkCTX.realVolts[0];
|
||||
realGPU_mV = sysclkCTX.realVolts[1];
|
||||
realRAM_mV = sysclkCTX.realVolts[2];
|
||||
realSOC_mV = sysclkCTX.realVolts[3];
|
||||
}
|
||||
realCPU_mV = sysclkCTX.voltages[HocClkVoltage_CPU];
|
||||
realGPU_mV = sysclkCTX.voltages[HocClkVoltage_GPU];
|
||||
realRAM_mV = sysclkCTX.voltages[HocClkVoltage_EMCVDDQ_MarikoOnly];
|
||||
realSOC_mV = sysclkCTX.voltages[HocClkVoltage_SOC];
|
||||
}
|
||||
}
|
||||
|
||||
// Read voltages directly if not using EOS
|
||||
if (canReadVoltages) {
|
||||
RgltrSession session;
|
||||
u32 vdd2_raw = 0, vddq_raw = 0;
|
||||
|
||||
// CPU voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, domains[0]))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realCPU_mV))) {
|
||||
realCPU_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// GPU voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, domains[1]))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realGPU_mV))) {
|
||||
realGPU_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// VDD2 (DRAM)
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, domains[2]))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &vdd2_raw))) {
|
||||
vdd2_raw = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// SOC voltage
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, domains[3]))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &realSOC_mV))) {
|
||||
realSOC_mV = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// VDDQ
|
||||
if (R_SUCCEEDED(rgltrOpenSession(&session, domains[4]))) {
|
||||
if (R_FAILED(rgltrGetVoltage(&session, &vddq_raw))) {
|
||||
vddq_raw = 0;
|
||||
}
|
||||
rgltrCloseSession(&session);
|
||||
}
|
||||
|
||||
// Pack VDD2 and VDDQ into realRAM_mV in sys-clk format
|
||||
const u32 vdd2_mV = vdd2_raw / 1000; // µV to mV
|
||||
const u32 vddq_mV = vddq_raw / 1000; // µV to mV
|
||||
realRAM_mV = vdd2_mV * 100000 + vddq_mV * 10;
|
||||
}
|
||||
|
||||
// Temperatures
|
||||
if (R_SUCCEEDED(i2cCheck)) {
|
||||
Tmp451GetSocTemp(&SOC_temperatureF);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
#include "../../sys-clk/common/include/sysclk.h"
|
||||
|
||||
//static tsl::elm::HeaderOverlayFrame* rootFrame = nullptr;
|
||||
static bool skipMain = false;
|
||||
static std::string lastSelectedItem;
|
||||
@@ -128,7 +130,7 @@ public:
|
||||
// list->addItem(Res);
|
||||
//}
|
||||
//tsl::elm::g_disableMenuCacheOnReturn.store(true, std::memory_order_release);
|
||||
tsl::elm::HeaderOverlayFrame* rootFrame = new tsl::elm::HeaderOverlayFrame("Status Monitor", "Modes");
|
||||
tsl::elm::HeaderOverlayFrame* rootFrame = new tsl::elm::HeaderOverlayFrame("Horizon OC Monitor", "Modes");
|
||||
if (!lastSelectedItem.empty()) {
|
||||
list->jumpToItem(lastSelectedItem);
|
||||
}
|
||||
|
||||
@@ -496,8 +496,8 @@ public:
|
||||
snprintf(CPU_Load_c, sizeof(CPU_Load_c), "%.1f%%", cpu_usageM);
|
||||
snprintf(GPU_Load_c, sizeof(GPU_Load_c), "%d.%d%%", GPU_Load_u / 10, GPU_Load_u % 10);
|
||||
snprintf(RAM_Load_c, sizeof(RAM_Load_c), "%hu.%hhu%%",
|
||||
PartLoad[SysClkPartLoad_EMC] / 10,
|
||||
PartLoad[SysClkPartLoad_EMC] % 10);
|
||||
ramLoad[SysClkPartLoad_EMC] / 10,
|
||||
ramLoad[SysClkPartLoad_EMC] % 10);
|
||||
|
||||
mutexUnlock(&mutex_Misc);
|
||||
|
||||
|
||||
@@ -446,11 +446,11 @@ public:
|
||||
);
|
||||
|
||||
if (R_SUCCEEDED(sysclkCheck)) {
|
||||
const int RAM_GPU_Load = PartLoad[SysClkPartLoad_EMC] - PartLoad[SysClkPartLoad_EMCCpu];
|
||||
const int RAM_GPU_Load = ramLoad[SysClkPartLoad_EMC] - ramLoad[SysClkPartLoad_EMCCpu];
|
||||
snprintf(RAM_load_c, sizeof RAM_load_c,
|
||||
"%u.%u%% CPU %u.%u%% GPU %u.%u%%",
|
||||
ramLoad[SysClkRamLoad_All] / 10, ramLoad[SysClkRamLoad_All] % 10,
|
||||
ramLoad[SysClkRamLoad_Cpu] / 10, ramLoad[SysClkRamLoad_Cpu] % 10,
|
||||
ramLoad[SysClkPartLoad_EMC] / 10, ramLoad[SysClkPartLoad_EMC] % 10,
|
||||
ramLoad[SysClkPartLoad_EMCCpu] / 10, ramLoad[SysClkPartLoad_EMCCpu] % 10,
|
||||
RAM_GPU_Load / 10, RAM_GPU_Load % 10);
|
||||
}
|
||||
///Thermal
|
||||
|
||||
@@ -821,7 +821,7 @@ public:
|
||||
if (R_SUCCEEDED(sysclkCheck)) {
|
||||
// Use sys-clk's RAM load if available
|
||||
snprintf(MICRO_RAM_all_c, sizeof(MICRO_RAM_all_c), "%hu%%",
|
||||
PartLoad[SysClkPartLoad_EMC] / 10);
|
||||
ramLoad[SysClkPartLoad_EMC] / 10);
|
||||
} else {
|
||||
// Calculate percentage manually when sys-clk isn't available
|
||||
const uint64_t RAM_Total_all = RAM_Total_application_u + RAM_Total_applet_u + RAM_Total_system_u + RAM_Total_systemunsafe_u;
|
||||
|
||||
@@ -994,11 +994,11 @@ public:
|
||||
unsigned ramLoadInt;
|
||||
|
||||
if (R_SUCCEEDED(sysclkCheck)) {
|
||||
ramLoadInt = PartLoad[SysClkPartLoad_EMC] / 10;
|
||||
ramLoadInt = ramLoad[SysClkPartLoad_EMC] / 10;
|
||||
|
||||
if (settings.showRAMLoadCPUGPU) {
|
||||
unsigned ramCpuLoadInt = ramLoad[SysClkRamLoad_Cpu] / 10;
|
||||
int RAM_GPU_Load = ramLoad[SysClkRamLoad_All] - ramLoad[SysClkRamLoad_Cpu];
|
||||
unsigned ramCpuLoadInt = ramLoad[SysClkPartLoad_EMCCpu] / 10;
|
||||
int RAM_GPU_Load = ramLoad[SysClkPartLoad_EMC] - ramLoad[SysClkPartLoad_EMCCpu];
|
||||
unsigned ramGpuLoadInt = RAM_GPU_Load / 10;
|
||||
|
||||
if (settings.realFrequencies && realRAM_Hz) {
|
||||
|
||||
Reference in New Issue
Block a user