hocclk: rename mem display unit to ram display unit
This commit is contained in:
@@ -169,11 +169,11 @@ typedef enum {
|
||||
} MemoryFrequencyMeasurementMode;
|
||||
|
||||
typedef enum {
|
||||
MemDisplayUnit_MHz = 0,
|
||||
MemDisplayUnit_MTs,
|
||||
MemDisplayUnit_Both,
|
||||
MemDisplayUnit_EnumMax,
|
||||
} MemDisplayUnit;
|
||||
RamDisplayUnit_MHz = 0,
|
||||
RamDisplayUnit_MTs,
|
||||
RamDisplayUnit_MHzMTs,
|
||||
RamDisplayUnit_EnumMax,
|
||||
} RamDisplayUnit;
|
||||
|
||||
#define HOCCLK_ENUM_VALID(n, v) ((v) < n##_EnumMax)
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ typedef enum {
|
||||
HocClkConfigValue_DisplayVoltage,
|
||||
|
||||
HocClkConfigValue_MemoryFrequencyMeasurementMode,
|
||||
HocClkConfigValue_MemDisplayUnit,
|
||||
HocClkConfigValue_RamDisplayUnit,
|
||||
|
||||
KipConfigValue_custRev,
|
||||
// KipConfigValue_mtcConf,
|
||||
@@ -263,7 +263,7 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||
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";
|
||||
|
||||
// KIP config values
|
||||
@@ -447,8 +447,8 @@ static inline uint64_t hocclkDefaultConfigValue(HocClkConfigValue val)
|
||||
case HocClkConfigValue_GPUSchedulingMethod:
|
||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||
return 0ULL;
|
||||
case HocClkConfigValue_MemDisplayUnit:
|
||||
return (uint64_t)MemDisplayUnit_MHz;
|
||||
case HocClkConfigValue_RamDisplayUnit:
|
||||
return (uint64_t)RamDisplayUnit_MHz;
|
||||
case HocClkConfigValue_EristaMaxCpuClock:
|
||||
return 1785ULL;
|
||||
|
||||
@@ -605,7 +605,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
||||
case HocClkConfigValue_RAMVoltDisplayMode:
|
||||
case HocClkConfigValue_CpuGovernorMinimumFreq:
|
||||
case HocClkConfigValue_MemoryFrequencyMeasurementMode:
|
||||
case HocClkConfigValue_MemDisplayUnit:
|
||||
case HocClkConfigValue_RamDisplayUnit:
|
||||
return true;
|
||||
case HocClkConfigValue_BatteryChargeCurrent:
|
||||
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 formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
||||
static inline std::string formatListFreqMem(uint32_t mhz, RamDisplayUnit unit)
|
||||
{
|
||||
if(mhz == 0)
|
||||
return FREQ_DEFAULT_TEXT;
|
||||
@@ -56,13 +56,13 @@ static inline std::string formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
||||
char buf[24];
|
||||
switch(unit)
|
||||
{
|
||||
case MemDisplayUnit_MHz:
|
||||
case RamDisplayUnit_MHz:
|
||||
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
||||
break;
|
||||
case MemDisplayUnit_Both:
|
||||
case RamDisplayUnit_MHzMTs:
|
||||
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
||||
break;
|
||||
case MemDisplayUnit_MTs:
|
||||
case RamDisplayUnit_MTs:
|
||||
default:
|
||||
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
||||
break;
|
||||
@@ -70,25 +70,25 @@ static inline std::string formatListFreqMem(uint32_t mhz, MemDisplayUnit unit)
|
||||
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);
|
||||
}
|
||||
|
||||
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 mts = khz / 500;
|
||||
char buf[32];
|
||||
switch(unit)
|
||||
{
|
||||
case MemDisplayUnit_MHz:
|
||||
case RamDisplayUnit_MHz:
|
||||
snprintf(buf, sizeof(buf), "%u MHz", mhz);
|
||||
break;
|
||||
case MemDisplayUnit_Both:
|
||||
case RamDisplayUnit_MHzMTs:
|
||||
snprintf(buf, sizeof(buf), "%u MHz (%u MT/s)", mhz, mts);
|
||||
break;
|
||||
case MemDisplayUnit_MTs:
|
||||
case RamDisplayUnit_MTs:
|
||||
default:
|
||||
snprintf(buf, sizeof(buf), "%u MT/s", mts);
|
||||
break;
|
||||
|
||||
@@ -59,7 +59,7 @@ void AppProfileGui::openFreqChoiceGui(tsl::elm::ListItem* listItem, HocClkProfil
|
||||
} else if (module == HocClkModule_GPU) {
|
||||
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) {
|
||||
this->profileList->mhzMap[profile][module] = hz / 1000000;
|
||||
std::uint32_t mhz = this->profileList->mhzMap[profile][module];
|
||||
@@ -106,7 +106,7 @@ void AppProfileGui::openValueChoiceGui(
|
||||
void AppProfileGui::addModuleListItem(HocClkProfile profile, HocClkModule module)
|
||||
{
|
||||
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];
|
||||
listItem->setValue(module == HocClkModule_MEM ? formatListFreqMem(mhz, memUnit) : formatListFreqMHz(mhz));
|
||||
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);
|
||||
}
|
||||
|
||||
std::vector<NamedValue> memDisplayUnitValues = {
|
||||
NamedValue("MHz", MemDisplayUnit_MHz),
|
||||
NamedValue("MT/s", MemDisplayUnit_MTs),
|
||||
NamedValue("Both", MemDisplayUnit_Both),
|
||||
std::vector<NamedValue> RamDisplayUnitValues = {
|
||||
NamedValue("MHz", RamDisplayUnit_MHz),
|
||||
NamedValue("MT/s", RamDisplayUnit_MTs),
|
||||
NamedValue("MHz and MT/s", RamDisplayUnit_MHzMTs),
|
||||
};
|
||||
addConfigButton(
|
||||
HocClkConfigValue_MemDisplayUnit,
|
||||
HocClkConfigValue_RamDisplayUnit,
|
||||
"RAM Display Unit",
|
||||
ValueRange(0, 0, 2, "", 0),
|
||||
"RAM Display Unit",
|
||||
&thresholdsDisabled,
|
||||
{},
|
||||
memDisplayUnitValues,
|
||||
RamDisplayUnitValues,
|
||||
false
|
||||
|
||||
);
|
||||
@@ -951,7 +951,7 @@ protected:
|
||||
// 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)
|
||||
nv.name = formatMemClockKhzLabel(nv.value, unit);
|
||||
|
||||
@@ -1320,7 +1320,7 @@ protected:
|
||||
|
||||
ValueThresholds thresholdsDisabled(0, 0);
|
||||
// 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(800000, unit)));
|
||||
@@ -1855,7 +1855,7 @@ void MiscGui::refresh() {
|
||||
updateConfigToggles();
|
||||
|
||||
// relabel when display unit changes
|
||||
MemDisplayUnit unit = (MemDisplayUnit)this->configList->values[HocClkConfigValue_MemDisplayUnit];
|
||||
RamDisplayUnit unit = (RamDisplayUnit)this->configList->values[HocClkConfigValue_RamDisplayUnit];
|
||||
constexpr HocClkConfigValue emcKeys[] = {
|
||||
KipConfigValue_marikoEmcMaxClock,
|
||||
KipConfigValue_eristaEmcMaxClock,
|
||||
|
||||
Reference in New Issue
Block a user