private void updateButton_Click(object sender, EventArgs e) { //Brazos merge next line from BT //for (int i = 0; i < 5; i++) for (int i = 0; i < 10; i++) { _pStates[i] = PState.Load(i); // disable the current P-state and all following ones in case the // first core's CPU VID is > than the previous P-state's //Brazos merge next line from BT //if ((i > 0 && _pStates[i].Msrs[0].Vid > _pStates[i - 1].Msrs[0].Vid) && (i < 3)) //ignore Vids from NB in comprison if ((i > 0 && _pStates[i].Msrs[0].Vid > _pStates[i - 1].Msrs[0].Vid) && (i < 8)) //ignore Vids from NB in comparison { //Brazos merge next line from BT //for (int j = i; j < 5; j++) for (int j = i; j < 8; j++) { _pStates[j] = null; } break; } } RefreshPStatesLabel(); }
/// <summary> /// Loads the P-state settings from each core's MSR. /// </summary> public void LoadFromHardware() { if (_index < 0) { throw new InvalidOperationException("The PStateIndex property needs to be initialized first."); } if (_index < 8) //hardware loads for CPU { //FT if (_index <= K10Manager.GetHighestPState() + K10Manager.GetNumBoostedStates()) //skip, in case index is bigger than initialized CPU PStates if (_index <= 7)//_maxPstate) //skip, in case just 2 CPU PStates are initialized { _pState = PState.Load(_index); double maxCpuVid = 0; for (int i = 0; i < _pState.Msrs.Length; i++)//iterating through cores { var msr = _pState.Msrs[i]; var control = (NumericUpDown)flowLayoutPanel1.Controls[i]; control.Value = (decimal)msr.CPUMultNBDivider; maxCpuVid = Math.Max(maxCpuVid, msr.Vid); } VidNumericUpDown.Value = Math.Min(VidNumericUpDown.Maximum, (decimal)maxCpuVid); //int check = K10Manager.SetBIOSBusSpeed(80); pllfreq.Text = "P" + _index + " Freq (CPU): "; clockvalue.Text = K10Manager.GetBIOSBusSpeed() + "MHz"; freqvalue.Text = (int)_pState.Msrs[0].PLL + "MHz"; if ((Form1.family == 12) || (Form1.family == 16)) //Llano + Kabini { Cofstate.Text = "Mult = "; } else //Brazos { Cofstate.Text = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->"; } Form1.freq[_index] = (int)_pState.Msrs[0].PLL; if (PStateIndex <= _maxPstate) { checkBox_Penable.Checked = true; checkBox_Penable.Enabled = false; } else { checkBox_Penable.Checked = false; checkBox_Penable.Enabled = false; } } else { VidNumericUpDown.Value = (decimal)0.4; } } else if (_index == 8) { //hardware loads for NB P0 _pState = PState.Load(_index); var control = (NumericUpDown)flowLayoutPanel1.Controls[0]; control.Value = (decimal)K10Manager.GetNbDivPState0(); VidNumericUpDown.Value = (decimal)(1.55 - 0.0125 * K10Manager.GetNbVidPState0()); pllfreq.Text = "NB P0 Freq (GPU): "; Cofstate.Text = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->"; clockvalue.Text = K10Manager.GetBIOSBusSpeed() + "MHz"; freqvalue.Text = (int)_pState.Msrs[0].PLL + "MHz"; Form1.freq[_index] = (int)_pState.Msrs[0].PLL; checkBox_Penable.Checked = true; checkBox_Penable.Enabled = false; } else if (_index == 9) { //hardware loads for NB P1 _pState = PState.Load(_index); var control = (NumericUpDown)flowLayoutPanel1.Controls[0]; control.Value = (decimal)K10Manager.GetNbDivPState1(); VidNumericUpDown.Value = (decimal)(1.55 - 0.0125 * K10Manager.GetNbVidPState1()); pllfreq.Text = "NB P1 Freq (GPU): "; clockvalue.Text = K10Manager.GetBIOSBusSpeed() + "MHz"; freqvalue.Text = (int)_pState.Msrs[0].PLL + "MHz"; Cofstate.Text = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->"; Form1.freq[_index] = (int)_pState.Msrs[0].PLL; checkBox_Penable.Checked = true; checkBox_Penable.Enabled = false; } else if (_index == 10) //settings for displaying registers { VidNumericUpDown.Value = 1; } _modified = false; }