add voltage-frequency curve setting for RDNA 3

This commit is contained in:
Jussi Kuokkanen 2023-11-03 11:34:33 +02:00
parent a0e7477ca0
commit 8bfaf3e0d5
3 changed files with 18 additions and 5 deletions

View File

@ -384,9 +384,12 @@ std::vector<TreeNode<DeviceNode>> getVoltFreqFreq(AMDGPUData data) {
Assignable a{setWithPerfLevel, *range, getFunc, _("MHz")};
pointId++;
// The rest of this code should work the same on Navi and RDNA 3
auto name = (*data.ppTableType == Navi) ? _("Core Clock") : _("Core Clock Offset");
if (getFunc().has_value())
return {DeviceNode{
.name = _("Core Clock"),
.name = name,
.interface = a,
.hash = md5(data.pciId + "VFClock" + std::to_string(id)),
}};
@ -449,9 +452,12 @@ std::vector<TreeNode<DeviceNode>> getVoltFreqVolt(AMDGPUData data) {
Assignable a{setWithPerfLevel, *range, getFunc, _("mV")};
pointId++;
// The rest of this code should work the same on Navi and RDNA 3
auto name = (*data.ppTableType == Navi) ? _("Core Voltage") : _("Core Voltage Offset");
if (getFunc().has_value())
return {DeviceNode{
.name = _("Core Voltage"),
.name = name,
.interface = a,
.hash = md5(data.pciId + "VFVoltage" + std::to_string(id)),
}};
@ -461,7 +467,8 @@ std::vector<TreeNode<DeviceNode>> getVoltFreqVolt(AMDGPUData data) {
std::vector<TreeNode<DeviceNode>> getVoltFreqNodes(AMDGPUData data) {
// Root item for voltage and frequency of a point
std::vector<TreeNode<DeviceNode>> retval;
if (!data.ppTableType.has_value() || *data.ppTableType != Navi)
if (!data.ppTableType.has_value() || *data.ppTableType != Navi ||
*data.ppTableType != SMU13)
return {};
auto path = data.hwmonPath + "/pp_od_clk_voltage";
@ -543,7 +550,8 @@ std::vector<TreeNode<DeviceNode>> getForcePerfLevel(AMDGPUData data) {
}
std::vector<TreeNode<DeviceNode>> getVoltFreqRoot(AMDGPUData data) {
if (data.ppTableType.has_value() && *data.ppTableType == Navi)
if (data.ppTableType.has_value() &&
(*data.ppTableType == Navi || *data.ppTableType == SMU13))
return {DeviceNode{
.name = _("Voltage-Frequency Curve"),
.interface = std::nullopt,

View File

@ -118,6 +118,10 @@ std::optional<PPTableType> fromPPTableContents(const std::string &contents) {
// Navi (NV1X?) has three frequency-voltage points
if (first.has_value() && !fourth.has_value())
return Navi;
// RDNA 3 (SMU13) has six points using offsets
if (first.has_value() && fourth.has_value())
return SMU13;
}
}
return std::nullopt;

View File

@ -12,7 +12,8 @@ namespace fs = std::filesystem;
enum PPTableType {
Vega10,
Navi
Navi,
SMU13 // RDNA 3
};
struct VFPoint {