Skip to content

Commit

Permalink
Now works with Carrizo
Browse files Browse the repository at this point in the history
- Updated README.md to reflect current GIT repo
- Increased version number a bit
  • Loading branch information
sweoggy committed Nov 14, 2015
1 parent bc841b8 commit 802c2a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion AmdMsrTweaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(int argc, const char* argv[])
void PrintInfo(const Info& info)
{
cout << endl;
cout << "AmdMsrTweaker v1.1" << endl;
cout << "AmdMsrTweaker v2.0" << endl;
cout << endl;

cout << ".:. General" << endl << "---" << endl;
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@ Usage
-----

If you just want to use the tool, just download the precompiled binary and
follow the directions in the readme.txt file:
* [AmdMsrTweaker v1.1](https://mega.co.nz/#!C0wk2ZQC!cMaQODozN40y3elVHbSCDkv-irVJ69HkeR5da2TT0gg)
follow the directions in the readme.txt file found in the git repository.


Development
-----------

The project is set up using Visual Studio 2010. Using the Express Edition is
also possible, though for compiling 64bit builds the respective Windows SDK is
needed.
The project is set up using Visual Studio 2015, utilising the C++11 standard in some parts of the code.

Additionally you need to download the WinRing0 library, which is not included in
the Git repository:
* [WinRing0_lib.zip](https://mega.co.nz/#!StAywLoT!K0-wx0n-6_9npwH64hb1vmgBKbFqv660X38-9paSw84)

Just check out the repository, extract the WinRing0_lib.zip file and then you
should be able to compile it in Visual Studio.
The project requires WinRing0, which is now included in the git repository. See WinRing0 folder for copyright
21 changes: 15 additions & 6 deletions Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,17 @@ void Worker::ApplyChanges()
{
const Info& info = *_info;
#ifdef _DEBUG
unsigned short sleepDelay = 5;
unsigned short sleepDelay = 0;
string sleepText = ", waiting for " + std::to_string(sleepDelay) + "seconds.";
#endif

// Apply NB P-states
#ifdef _DEBUG
cerr << "Applying NB P-states, waiting for 5 seconds" << endl;
cerr << "Applying NB P-states" << sleepText << endl;
std::this_thread::sleep_for(std::chrono::seconds(sleepDelay));
#endif
if (info.Family == 0x15)
//Changing NB P-states causes system hang on Carrizo (Model == 0x60), disable for now
if (info.Family == 0x15 && info.Model != 0x60)
{
for (int i = 0; i < _nbPStates.size(); i++)
{
Expand All @@ -226,19 +227,22 @@ void Worker::ApplyChanges()
{
PStateInfo& psi = _pStates[i];

const int nbPState = (psi.NBPState >= 0 ? psi.NBPState :
info.ReadPState(i).NBPState);
const int nbPState = (psi.NBPState >= 0 ? psi.NBPState : info.ReadPState(i).NBPState);
const NBPStateInfo& nbpsi = _nbPStates[nbPState];

if (nbpsi.VID >= 0)
psi.NBVID = nbpsi.VID;
}
}
#ifdef _DEBUG
if (_nbPStates.size() > 0)
if (_nbPStates.size() > 0 && (info.Family == 0x15 && info.Model != 0x60))
{
cerr << "NB P-states successfully applied" << endl;
}
else if (info.Family == 0x15 && info.Model == 0x60)
{
cerr << "Modifying P-states on Carrizo is disabled for now (causes system hang)" << endl;
}
else
{
cerr << "No P-states applied (non were specified)" << endl;
Expand Down Expand Up @@ -340,4 +344,9 @@ void Worker::ApplyChanges()

SetThreadPriority(hThread, THREAD_PRIORITY_NORMAL);
SetPriorityClass(hProcess, NORMAL_PRIORITY_CLASS);

#ifdef _DEBUG
cerr << "Successfully executed all steps, exiting in 5 seconds" << endl;
std::this_thread::sleep_for(std::chrono::seconds(5));
#endif
}

0 comments on commit 802c2a7

Please sign in to comment.