hocclk: rename mem display unit to ram display unit
This commit is contained in:
@@ -169,11 +169,11 @@ typedef enum {
|
|||||||
} MemoryFrequencyMeasurementMode;
|
} MemoryFrequencyMeasurementMode;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MemDisplayUnit_MHz = 0,
|
RamDisplayUnit_MHz = 0,
|
||||||
MemDisplayUnit_MTs,
|
RamDisplayUnit_MTs,
|
||||||
MemDisplayUnit_Both,
|
RamDisplayUnit_MHzMTs,
|
||||||
MemDisplayUnit_EnumMax,
|
RamDisplayUnit_EnumMax,
|
||||||
} MemDisplayUnit;
|
} RamDisplayUnit;
|
||||||
|
|
||||||
#define HOCCLK_ENUM_VALID(n, v) ((v) < n##_EnumMax)
|
#define HOCCLK_ENUM_VALID(n, v) ((v) < n##_EnumMax)
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ typedef enum {
|
|||||||
HocClkConfigValue_DisplayVoltage,
|
HocClkConfigValue_DisplayVoltage,
|
||||||
|
|
||||||
HocClkConfigValue_MemoryFrequencyMeasurementMode,
|
HocClkConfigValue_MemoryFrequencyMeasurementMode,
|
||||||
HocClkConfigValue_MemDisplayUnit,
|
HocClkConfigValue_RamDisplayUnit,
|
||||||
|
|
||||||
KipConfigValue_custRev,
|
KipConfigValue_custRev,
|
||||||
// KipConfigValue_mtcConf,
|
// KipConfigValue_mtcConf,
|
||||||
@@ -263,7 +263,7 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
|||||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||||
return pretty ? "Memory Frequency Measurement Mode" : "mem_freq_measurement_mode";
|
return pretty ? "Memory Frequency Measurement Mode" : "mem_freq_measurement_mode";
|
||||||
|
|
||||||
case HocClkConfigValue_MemDisplayUnit:
|
case HocClkConfigValue_RamDisplayUnit:
|
||||||
return pretty ? "Memory Frequency Display Unit" : "mem_display_unit";
|
return pretty ? "Memory Frequency Display Unit" : "mem_display_unit";
|
||||||
|
|
||||||
// KIP config values
|
// KIP config values
|
||||||
@@ -447,8 +447,8 @@ static inline uint64_t hocclkDefaultConfigValue(HocClkConfigValue val)
|
|||||||
case HocClkConfigValue_GPUSchedulingMethod:
|
case HocClkConfigValue_GPUSchedulingMethod:
|
||||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||||
return 0ULL;
|
return 0ULL;
|
||||||
case HocClkConfigValue_MemDisplayUnit:
|
case HocClkConfigValue_RamDisplayUnit:
|
||||||
return (uint64_t)MemDisplayUnit_MHz;
|
return (uint64_t)RamDisplayUnit_MHz;
|
||||||
case HocClkConfigValue_EristaMaxCpuClock:
|
case HocClkConfigValue_EristaMaxCpuClock:
|
||||||
return 1785ULL;
|
return 1785ULL;
|
||||||
|
|
||||||
@@ -605,7 +605,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
|||||||
case HocClkConfigValue_RAMVoltDisplayMode:
|
case HocClkConfigValue_RAMVoltDisplayMode:
|
||||||
case HocClkConfigValue_CpuGovernorMinimumFreq:
|
case HocClkConfigValue_CpuGovernorMinimumFreq:
|
||||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||||
case HocClkConfigValue_MemDisplayUnit:
|
case HocClkConfigValue_RamDisplayUnit:
|
||||||
return true;
|
return true;
|
||||||
case HocClkConfigValue_BatteryChargeCurrent:
|
case HocClkConfigValue_BatteryChargeCurrent:
|
||||||
return ((input >= 1024) && (input <= 3072)) || !input;
|
return ((input >= 1024) && (input <= 3072)) || !input;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ static inline std::string formatListFreqMHz(std::uint32_t mhz)
|
|||||||
|
|
||||||
static inline std::string formatListFreqHz(uint32_t hz) { return formatListFreqMHz(hz / 1000000); }
|
static inline std::string formatListFreqHz(uint32_t hz) { return formatListFreqMHz(hz / 1000000); }
|
||||||
|
|
||||||
static inline std::string formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
static inline std::string formatListFreqMem(uint32_t mhz, RamDisplayUnit unit)
|
||||||
{
|
{
|
||||||
if(mhz == 0)
|
if(mhz == 0)
|
||||||
return FREQ_DEFAULT_TEXT;
|
return FREQ_DEFAULT_TEXT;
|
||||||
@@ -56,13 +56,13 @@ static inline std::string formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
|||||||
char buf[24];
|
char buf[24];
|
||||||
switch(unit)
|
switch(unit)
|
||||||
{
|
{
|
||||||
case MemDisplayUnit_MHz:
|
case RamDisplayUnit_MHz:
|
||||||
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
||||||
break;
|
break;
|
||||||
case MemDisplayUnit_Both:
|
case RamDisplayUnit_MHzMTs:
|
||||||
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
||||||
break;
|
break;
|
||||||
case MemDisplayUnit_MTs:
|
case RamDisplayUnit_MTs:
|
||||||
default:
|
default:
|
||||||
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
||||||
break;
|
break;
|
||||||
@@ -70,25 +70,25 @@ static inline std::string formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline std::string formatListFreqHzMem(uint32_t hz, MemDisplayUnit unit)
|
static inline std::string formatListFreqHzMem(uint32_t hz, RamDisplayUnit unit)
|
||||||
{
|
{
|
||||||
return formatListFreqMem(hz / 1000000, unit);
|
return formatListFreqMem(hz / 1000000, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline std::string formatMemClockKhzLabel(uint32_t khz, MemDisplayUnit unit)
|
static inline std::string formatMemClockKhzLabel(uint32_t khz, RamDisplayUnit unit)
|
||||||
{
|
{
|
||||||
uint32_t mhz = khz / 1000;
|
uint32_t mhz = khz / 1000;
|
||||||
uint32_t mts = khz / 500;
|
uint32_t mts = khz / 500;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
switch(unit)
|
switch(unit)
|
||||||
{
|
{
|
||||||
case MemDisplayUnit_MHz:
|
case RamDisplayUnit_MHz:
|
||||||
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
||||||
break;
|
break;
|
||||||
case MemDisplayUnit_Both:
|
case RamDisplayUnit_MHzMTs:
|
||||||
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
||||||
break;
|
break;
|
||||||
case MemDisplayUnit_MTs:
|
case RamDisplayUnit_MTs:
|
||||||
default:
|
default:
|
||||||
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void AppProfileGui::openFreqChoiceGui(tsl::elm::ListItem* listItem, HocClkProfil
|
|||||||
} else if (module == HocClkModule_GPU) {
|
} else if (module == HocClkModule_GPU) {
|
||||||
labels = IsMariko() ? *(marikoUV[configList.values[KipConfigValue_marikoGpuUV]]) : *(eristaUV[configList.values[KipConfigValue_eristaGpuUV]]);
|
labels = IsMariko() ? *(marikoUV[configList.values[KipConfigValue_marikoGpuUV]]) : *(eristaUV[configList.values[KipConfigValue_eristaGpuUV]]);
|
||||||
}
|
}
|
||||||
MemDisplayUnit memUnit = (MemDisplayUnit)configList.values[HocClkConfigValue_MemDisplayUnit];
|
RamDisplayUnit memUnit = (RamDisplayUnit)configList.values[HocClkConfigValue_RamDisplayUnit];
|
||||||
tsl::changeTo<FreqChoiceGui>(this->profileList->mhzMap[profile][module] * 1000000, hzList, hzCount, module, [this, listItem, profile, module, memUnit](std::uint32_t hz) {
|
tsl::changeTo<FreqChoiceGui>(this->profileList->mhzMap[profile][module] * 1000000, hzList, hzCount, module, [this, listItem, profile, module, memUnit](std::uint32_t hz) {
|
||||||
this->profileList->mhzMap[profile][module] = hz / 1000000;
|
this->profileList->mhzMap[profile][module] = hz / 1000000;
|
||||||
std::uint32_t mhz = this->profileList->mhzMap[profile][module];
|
std::uint32_t mhz = this->profileList->mhzMap[profile][module];
|
||||||
@@ -106,7 +106,7 @@ void AppProfileGui::openValueChoiceGui(
|
|||||||
void AppProfileGui::addModuleListItem(HocClkProfile profile, HocClkModule module)
|
void AppProfileGui::addModuleListItem(HocClkProfile profile, HocClkModule module)
|
||||||
{
|
{
|
||||||
tsl::elm::ListItem* listItem = new tsl::elm::ListItem(hocclkFormatModule(module, true));
|
tsl::elm::ListItem* listItem = new tsl::elm::ListItem(hocclkFormatModule(module, true));
|
||||||
MemDisplayUnit memUnit = (MemDisplayUnit)configList.values[HocClkConfigValue_MemDisplayUnit];
|
RamDisplayUnit memUnit = (RamDisplayUnit)configList.values[HocClkConfigValue_RamDisplayUnit];
|
||||||
std::uint32_t mhz = this->profileList->mhzMap[profile][module];
|
std::uint32_t mhz = this->profileList->mhzMap[profile][module];
|
||||||
listItem->setValue(module == HocClkModule_MEM ? formatListFreqMem(mhz, memUnit) : formatListFreqMHz(mhz));
|
listItem->setValue(module == HocClkModule_MEM ? formatListFreqMem(mhz, memUnit) : formatListFreqMHz(mhz));
|
||||||
listItem->setClickListener([this, listItem, profile, module, memUnit](u64 keys) {
|
listItem->setClickListener([this, listItem, profile, module, memUnit](u64 keys) {
|
||||||
|
|||||||
@@ -540,19 +540,19 @@ protected:
|
|||||||
addConfigButton(HocClkConfigValue_RAMVoltDisplayMode, "RAM Voltage Display Mode", ValueRange(0, 12, 1, "", 0), "RAM Voltage Display Mode", &thresholdsDisabled, {}, ramVoltDispModes, false);
|
addConfigButton(HocClkConfigValue_RAMVoltDisplayMode, "RAM Voltage Display Mode", ValueRange(0, 12, 1, "", 0), "RAM Voltage Display Mode", &thresholdsDisabled, {}, ramVoltDispModes, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<NamedValue> memDisplayUnitValues = {
|
std::vector<NamedValue> RamDisplayUnitValues = {
|
||||||
NamedValue("MHz", MemDisplayUnit_MHz),
|
NamedValue("MHz", RamDisplayUnit_MHz),
|
||||||
NamedValue("MT/s", MemDisplayUnit_MTs),
|
NamedValue("MT/s", RamDisplayUnit_MTs),
|
||||||
NamedValue("Both", MemDisplayUnit_Both),
|
NamedValue("MHz and MT/s", RamDisplayUnit_MHzMTs),
|
||||||
};
|
};
|
||||||
addConfigButton(
|
addConfigButton(
|
||||||
HocClkConfigValue_MemDisplayUnit,
|
HocClkConfigValue_RamDisplayUnit,
|
||||||
"RAM Display Unit",
|
"RAM Display Unit",
|
||||||
ValueRange(0, 0, 2, "", 0),
|
ValueRange(0, 0, 2, "", 0),
|
||||||
"RAM Display Unit",
|
"RAM Display Unit",
|
||||||
&thresholdsDisabled,
|
&thresholdsDisabled,
|
||||||
{},
|
{},
|
||||||
memDisplayUnitValues,
|
RamDisplayUnitValues,
|
||||||
false
|
false
|
||||||
|
|
||||||
);
|
);
|
||||||
@@ -951,7 +951,7 @@ protected:
|
|||||||
// NamedValue("3500MHz (Needs ridiculous Speedo/PLL)", 3500000),
|
// NamedValue("3500MHz (Needs ridiculous Speedo/PLL)", 3500000),
|
||||||
};
|
};
|
||||||
|
|
||||||
MemDisplayUnit unit = (MemDisplayUnit)this->configList->values[HocClkConfigValue_MemDisplayUnit];
|
RamDisplayUnit unit = (RamDisplayUnit)this->configList->values[HocClkConfigValue_RamDisplayUnit];
|
||||||
for (auto& nv : marikoMaxEmcClock)
|
for (auto& nv : marikoMaxEmcClock)
|
||||||
nv.name = formatMemClockKhzLabel(nv.value, unit);
|
nv.name = formatMemClockKhzLabel(nv.value, unit);
|
||||||
|
|
||||||
@@ -1320,7 +1320,7 @@ protected:
|
|||||||
|
|
||||||
ValueThresholds thresholdsDisabled(0, 0);
|
ValueThresholds thresholdsDisabled(0, 0);
|
||||||
// 1600000, 1331200, 1065600, 800000, 665600, 408000, 204000
|
// 1600000, 1331200, 1065600, 800000, 665600, 408000, 204000
|
||||||
MemDisplayUnit unit = (MemDisplayUnit)this->configList->values[HocClkConfigValue_MemDisplayUnit];
|
RamDisplayUnit unit = (RamDisplayUnit)this->configList->values[HocClkConfigValue_RamDisplayUnit];
|
||||||
|
|
||||||
this->listElement->addItem(new tsl::elm::ListItem(formatMemClockKhzLabel(665600, unit)));
|
this->listElement->addItem(new tsl::elm::ListItem(formatMemClockKhzLabel(665600, unit)));
|
||||||
this->listElement->addItem(new tsl::elm::ListItem(formatMemClockKhzLabel(800000, unit)));
|
this->listElement->addItem(new tsl::elm::ListItem(formatMemClockKhzLabel(800000, unit)));
|
||||||
@@ -1855,7 +1855,7 @@ void MiscGui::refresh() {
|
|||||||
updateConfigToggles();
|
updateConfigToggles();
|
||||||
|
|
||||||
// relabel when display unit changes
|
// relabel when display unit changes
|
||||||
MemDisplayUnit unit = (MemDisplayUnit)this->configList->values[HocClkConfigValue_MemDisplayUnit];
|
RamDisplayUnit unit = (RamDisplayUnit)this->configList->values[HocClkConfigValue_RamDisplayUnit];
|
||||||
constexpr HocClkConfigValue emcKeys[] = {
|
constexpr HocClkConfigValue emcKeys[] = {
|
||||||
KipConfigValue_marikoEmcMaxClock,
|
KipConfigValue_marikoEmcMaxClock,
|
||||||
KipConfigValue_eristaEmcMaxClock,
|
KipConfigValue_eristaEmcMaxClock,
|
||||||
|
|||||||
Reference in New Issue
Block a user