mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
add AMD shutdown and slowdown temperatures
This commit is contained in:
parent
16c0c0ad94
commit
743473711a
@ -1064,6 +1064,44 @@ std::vector<TreeNode<DeviceNode>> getMinCoreClock(AMDGPUData data) {
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<TreeNode<DeviceNode>> getSlowdownTemperature(AMDGPUData data) {
|
||||||
|
auto string = fileContents(data.hwmonPath + "/temp1_crit");
|
||||||
|
if (!string.has_value())
|
||||||
|
return {};
|
||||||
|
|
||||||
|
// millicelsius -> celsius
|
||||||
|
StaticReadable sr{static_cast<uint>(std::stoi(*string)) / 1000, _("°C")};
|
||||||
|
|
||||||
|
return {DeviceNode{
|
||||||
|
.name = _("Slowdown Temperature"),
|
||||||
|
.interface = sr,
|
||||||
|
.hash = md5(data.pciId + "Slowdown Temperature"),
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<TreeNode<DeviceNode>> getShutdownTemperature(AMDGPUData data) {
|
||||||
|
auto string = fileContents(data.hwmonPath + "/temp1_emergency");
|
||||||
|
if (!string.has_value())
|
||||||
|
return {};
|
||||||
|
|
||||||
|
// millicelsius -> celsius
|
||||||
|
StaticReadable sr{static_cast<uint>(std::stoi(*string)) / 1000, _("°C")};
|
||||||
|
|
||||||
|
return {DeviceNode{
|
||||||
|
.name = _("Shutdown Temperature"),
|
||||||
|
.interface = sr,
|
||||||
|
.hash = md5(data.pciId + "Shutdown Temperature"),
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<TreeNode<DeviceNode>> getTemperatureRoot(AMDGPUData data) {
|
||||||
|
return {DeviceNode{
|
||||||
|
.name = _("Temperatures"),
|
||||||
|
.interface = std::nullopt,
|
||||||
|
.hash = md5(data.pciId + "Temperatures"),
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<TreeNode<DeviceNode>> getVoltFreqRoot(AMDGPUData data) {
|
std::vector<TreeNode<DeviceNode>> getVoltFreqRoot(AMDGPUData data) {
|
||||||
if (data.ppTableType.has_value() &&
|
if (data.ppTableType.has_value() &&
|
||||||
(*data.ppTableType == Navi || *data.ppTableType == SMU13))
|
(*data.ppTableType == Navi || *data.ppTableType == SMU13))
|
||||||
@ -1154,7 +1192,11 @@ std::vector<TreeNode<DeviceNode>> getGPUName(AMDGPUData data) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
auto gpuTree = TreeConstructor<AMDGPUData, DeviceNode>{
|
auto gpuTree = TreeConstructor<AMDGPUData, DeviceNode>{
|
||||||
getGPUName, {
|
getGPUName, {
|
||||||
|
{getTemperatureRoot, {
|
||||||
{getTemperature, {}},
|
{getTemperature, {}},
|
||||||
|
{getSlowdownTemperature, {}},
|
||||||
|
{getShutdownTemperature, {}}
|
||||||
|
}},
|
||||||
{getFanRoot, {
|
{getFanRoot, {
|
||||||
{getFanMode, {}},
|
{getFanMode, {}},
|
||||||
{getFanSpeedWrite, {}},
|
{getFanSpeedWrite, {}},
|
||||||
|
Loading…
Reference in New Issue
Block a user