Skip to content

Commit

Permalink
Disable PBO settings for newer SMU versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Sep 23, 2019
1 parent c5ea6bc commit e95173f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 21 deletions.
24 changes: 13 additions & 11 deletions NotificationIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public enum PerfEnh { None = 0, Default, Level1, Level2, Level3_OC, Level4_OC };
public static string mbVendor;
public static string cpuName;
public static string smuVersion;
public static int smuVersionInt;
public static UInt64 cpuType;
public static string biosVersion;

public static DataInterface di;
Expand Down Expand Up @@ -173,8 +175,6 @@ public NotificationIcon()
serviceTimeout = 0;
tempTimerHandler(null, null);

checkSmuVersion();

notifyIcon.Visible = true;

MinimizeFootprint();
Expand Down Expand Up @@ -398,6 +398,15 @@ void tempTimerHandler(object sender, ElapsedEventArgs e)

NotificationIcon.smuVersion = getSmuVersionString(di.MemRead(DataInterface.REG_SMU_VERSION));

NotificationIcon.cpuType = di.MemRead(DataInterface.REG_CPU_TYPE);
NotificationIcon.smuVersionInt = checkSmuVersion();

if ((smuVersionInt <= 2583 && cpuType <= 4)
|| (smuVersionInt <= 4316 && cpuType > 4 && cpuType <= 6))
{
MessageBox.Show("Newer SMU version required. The application will most probably not work correctly. Please use version older than 0.8.0.");
}

if ((di.MemRead(DataInterface.REG_SERVER_FLAGS) & DataInterface.FLAG_IS_AVAILABLE) == 0) isAvailable = false;
else isAvailable = true;

Expand Down Expand Up @@ -545,21 +554,14 @@ void GenTempIcons()
}
}

static void checkSmuVersion()
static int checkSmuVersion()
{
UInt64 cpuType = di.MemRead(DataInterface.REG_CPU_TYPE);
UInt64 version = di.MemRead(DataInterface.REG_SMU_VERSION);
int smuMajor = (int)((version & 0x00FF0000) >> 16);
int smuMinor = (int)((version & 0x0000FF00) >> 8);
int smu = smuMajor * 100 + smuMinor;

// MessageBox.Show(Convert.ToString(smu));

if ((smu <= 2583 && di.MemRead(DataInterface.REG_CPU_TYPE) <= 4)
|| (smu <= 4316 && cpuType > 4 && cpuType <= 6))
{
MessageBox.Show("Newer SMU version required. The application will most probably not work correctly. Please use version older than 0.8.0.");
}
return smu;
}

static void initVendorInfo()
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyInformationalVersion("0.8.0-beta")]
[assembly: AssemblyInformationalVersion("0.8.0-beta2")]
12 changes: 10 additions & 2 deletions SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ public SettingsForm()

ResetValues();

if (isZen2)
MessageBox.Show(Convert.ToString(NotificationIcon.smuVersionInt));

// if (isZen2)
if ((NotificationIcon.smuVersionInt > 2583 && NotificationIcon.cpuType <= 4)
|| (NotificationIcon.smuVersionInt > 4316 && NotificationIcon.cpuType > 4 && NotificationIcon.cpuType <= 6))

{
textBoxPPT.Enabled = false;
textBoxTDC.Enabled = false;
Expand All @@ -159,7 +164,10 @@ public SettingsForm()
toolTip.SetToolTip(labelEDC, "Electrical Design Current (A)");
toolTip.SetToolTip(labelTDC, "Thermal Design Current (A)");

if (isZen2)
//if (isZen2)
if ((NotificationIcon.smuVersionInt > 2583 && NotificationIcon.cpuType <= 4)
|| (NotificationIcon.smuVersionInt > 4316 && NotificationIcon.cpuType > 4 && NotificationIcon.cpuType <= 6))

{
toolTip.SetToolTip(checkBoxSmuPL, "It's currently not working with Zen2 and new AGESA");
toolTip.SetToolTip(comboBoxPerfenh, "It's currently not working with Zen2 and new AGESA");
Expand Down
6 changes: 3 additions & 3 deletions ZenStatesSrv/CPUHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,10 @@ public bool SetEDC(int edc)
public bool SetScalar(int scalar)
{
bool res;
if (cpuType >= CPUType.Matisse)
//if (cpuType >= CPUType.Matisse)
res = SmuWrite(SMC_MSG_SetFITLimitScalar, (UInt32)scalar);
else
res = SmuWrite(SMC_MSG_SetFITLimitScalar_ZEN1, (UInt32)scalar);
//else
// res = SmuWrite(SMC_MSG_SetFITLimitScalar_ZEN1, (UInt32)scalar);

if (res) ZenScalar = scalar;

Expand Down
9 changes: 5 additions & 4 deletions ZenStatesSrv/ZenStatesSrv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private static void applySettings()
if (cpuh.ZenOc)
{
if (cpuh.SetOcMode(true)) cpuh.setOverclockFrequencyAllCores(cpuh.PstateOc);
// cpuh.setCmdTemp(Convert.ToUInt32(cpuh.ZenScalar), Convert.ToUInt32(cpuh.ZenEDC));
}
else
{
Expand All @@ -185,12 +186,12 @@ private static void applySettings()
cpuh.SetC6Package(cpuh.ZenC6Package);
cpuh.SetCpb(cpuh.ZenCorePerfBoost);

if (cpuh.cpuType < CPUHandler.CPUType.Matisse)
/*if (cpuh.cpuType < CPUHandler.CPUType.Matisse)
{
cpuh.SetPPT(cpuh.ZenPPT);
cpuh.SetTDC(cpuh.ZenTDC);
cpuh.SetEDC(cpuh.ZenEDC);
}
}*/

cpuh.SetScalar(cpuh.ZenScalar);
cpuh.SetPerfBias(cpuh.PerformanceBias);
Expand Down Expand Up @@ -403,12 +404,12 @@ protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)
// Perf bias
cpuh.SetPerfBias(cpuh.PerformanceBias);

if (cpuh.cpuType >= CPUHandler.CPUType.Matisse)
/*if (cpuh.cpuType >= CPUHandler.CPUType.Matisse)
{
cpuh.SetPPT(cpuh.ZenPPT);
cpuh.SetTDC(cpuh.ZenTDC);
cpuh.SetEDC(cpuh.ZenEDC);
}
}*/
cpuh.SetScalar(cpuh.ZenScalar);
}

Expand Down

0 comments on commit e95173f

Please sign in to comment.