Skip to content

Commit 6d855fb

Browse files
committed
set power cap from oc profile instead of slider value
1 parent 743f4b1 commit 6d855fb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

radeon-profile/tab_overclock.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,24 @@ void radeon_profile::on_btn_removeOcProfile_clicked()
259259
}
260260

261261
void radeon_profile::setCurrentOcProfile(const QString &name) {
262+
const auto &ocp = ocProfiles.value(name);
263+
262264
if (tableHasBeenModified) {
263265
if (static_cast<ForcePowerLevels>(ui->combo_pLevel->currentIndex()) != ForcePowerLevels::F_MANUAL)
264266
device.setForcePowerLevel(ForcePowerLevels::F_MANUAL);
265267

266268
if (device.getDriverFeatures().isVDDCCurveAvailable)
267-
device.setOcTable("vc", ocProfiles.value(name).tables.value(OD_VDDC_CURVE));
269+
device.setOcTable("vc", ocp.tables.value(OD_VDDC_CURVE));
268270
else {
269-
device.setOcTable("s", ocProfiles.value(name).tables.value(OD_SCLK));
270-
device.setOcTable("m", ocProfiles.value(name).tables.value(OD_MCLK));
271+
device.setOcTable("s", ocp.tables.value(OD_SCLK));
272+
device.setOcTable("m", ocp.tables.value(OD_MCLK));
271273
}
272274

273275
device.sendOcTableCommand("c");
274276
}
275277

276-
if (device.getDriverFeatures().isPowerCapAvailable && device.gpuData[ValueID::POWER_CAP_CURRENT].value != ui->slider_powerCap->value())
277-
device.setPowerCap(ui->slider_powerCap->value());
278+
if (device.getDriverFeatures().isPowerCapAvailable)
279+
device.setPowerCap(ocp.powerCap);
278280

279281
ui->l_currentOcProfile->setText(name);
280282
ui->btn_ocProfileControl->menu()->actions()[findCurrentMenuIndex(ui->btn_ocProfileControl->menu(), name)]->setChecked(true);

0 commit comments

Comments
 (0)