update some stuff

This commit is contained in:
jussi 2019-02-27 18:51:11 +02:00
parent 3f64993657
commit f6fd0e850d
2 changed files with 20 additions and 7 deletions

19
amd.cpp
View File

@ -97,7 +97,9 @@ void amd::calculateUIProperties(int GPUIndex)
if (GPUList[GPUIndex].overVoltAvailable) { if (GPUList[GPUIndex].overVoltAvailable) {
GPUList[GPUIndex].voltageSliderCur = GPUList[GPUIndex].corevolts[GPUList[GPUIndex].corevolts.size()-1]; GPUList[GPUIndex].voltageSliderCur = GPUList[GPUIndex].corevolts[GPUList[GPUIndex].corevolts.size()-1];
} }
/*GPUList[GPUIndex].powerLimSliderCur = static_cast<int>(GPUList[GPUIndex].powerLim);*/ if (GPUList[GPUIndex].powerLimitAvailable) {
GPUList[GPUIndex].powerLimSliderCur = static_cast<int>(GPUList[GPUIndex].powerLim);
}
if (GPUList[GPUIndex].overClockAvailable) { if (GPUList[GPUIndex].overClockAvailable) {
GPUList[GPUIndex].memClkSliderCur = GPUList[GPUIndex].memvolts[GPUList[GPUIndex].memclocks.size()-1]; GPUList[GPUIndex].memClkSliderCur = GPUList[GPUIndex].memvolts[GPUList[GPUIndex].memclocks.size()-1];
GPUList[GPUIndex].coreClkSliderCur = GPUList[GPUIndex].coreclocks[GPUList[GPUIndex].coreclocks.size()-1]; GPUList[GPUIndex].coreClkSliderCur = GPUList[GPUIndex].coreclocks[GPUList[GPUIndex].coreclocks.size()-1];
@ -336,12 +338,16 @@ void amd::queryGPUUtils(int GPUIndex)
} }
void amd::queryGPUPowerDraw(int GPUIndex) void amd::queryGPUPowerDraw(int GPUIndex)
{ {
int reading = 0;
int ret = amdgpu_query_sensor_info(*GPUList[GPUIndex].dev, int ret = amdgpu_query_sensor_info(*GPUList[GPUIndex].dev,
AMDGPU_INFO_SENSOR_GPU_AVG_POWER, AMDGPU_INFO_SENSOR_GPU_AVG_POWER,
sizeof (GPUList[GPUIndex].powerDraw), sizeof (reading),
&GPUList[GPUIndex].powerDraw); &reading);
if (ret != 0) qDebug("failed to query GPU power draw"); if (ret != 0) qDebug("failed to query GPU power draw");
else qDebug() << GPUList[GPUIndex].powerDraw << "power draw"; else {
qDebug() << GPUList[GPUIndex].powerDraw << "power draw";
GPUList[GPUIndex].powerDraw = static_cast<double>(reading);
}
} }
void amd::queryGPUPowerLimit(int GPUIndex) void amd::queryGPUPowerLimit(int GPUIndex)
{ {
@ -420,6 +426,9 @@ bool amd::assignGPUFanCtlMode(int GPUIndex, bool manual)
bool amd::assignGPUFreqOffset(int GPUIndex, int targetValue){} bool amd::assignGPUFreqOffset(int GPUIndex, int targetValue){}
bool amd::assignGPUMemClockOffset(int GPUIndex, int targetValue){} bool amd::assignGPUMemClockOffset(int GPUIndex, int targetValue){}
bool amd::assignGPUVoltageOffset(int GPUIndex, int targetValue){} bool amd::assignGPUVoltageOffset(int GPUIndex, int targetValue){}
bool amd::assignGPUPowerLimit(uint targetValue){} bool amd::assignGPUPowerLimit(uint targetValue)
{
}
#endif #endif

View File

@ -105,16 +105,20 @@ void amdPstateEditor::generateUI(gputypes *newtypes, int GPUIndex)
state.freqspinbox = freqspinbox; state.freqspinbox = freqspinbox;
memPstates.append(state); memPstates.append(state);
} }
QWidget *buttonwidget = new QWidget;
QVBoxLayout *buttonlo = new QVBoxLayout;
// Add an apply button // Add an apply button
QPushButton *applyButton = new QPushButton; QPushButton *applyButton = new QPushButton;
connect(applyButton, SIGNAL(clicked()), SLOT(applyValues())); connect(applyButton, SIGNAL(clicked()), SLOT(applyValues()));
applyButton->setText("Apply values"); applyButton->setText("Apply values");
llo->addWidget(applyButton); buttonlo->addWidget(applyButton);
// Add a reset button // Add a reset button
QPushButton *resetButton = new QPushButton; QPushButton *resetButton = new QPushButton;
connect(resetButton, SIGNAL(clicked()), SLOT(resetPstates())); connect(resetButton, SIGNAL(clicked()), SLOT(resetPstates()));
resetButton->setText("Reset to defaults"); resetButton->setText("Reset to defaults");
llo->addWidget(resetButton); buttonlo->addWidget(resetButton);
buttonwidget->setLayout(buttonlo);
llo->addWidget(buttonwidget);
lower->setLayout(llo); lower->setLayout(llo);
upper->setLayout(ulo); upper->setLayout(ulo);