feat: Adjust CPU frequency values for specific device type#532
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom Sep 11, 2025
Merged
feat: Adjust CPU frequency values for specific device type#532deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
Conversation
Modified CPU frequency display for kSpecialType6 devices include current frequency and max frequency to correct hardware reporting inaccuracies. Log: Fix CPU frequency display for special device type Task: https://pms.uniontech.com/task-view-381765.html Change-Id: I3a715b263868c6825ee42941b64a7c5de6a53035
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdded a special-case adjustment in DeviceCpu to correct misreported CPU frequency values for kSpecialType6 devices by replacing specific frequency substrings. Class diagram for updated DeviceCpu frequency adjustmentclassDiagram
class DeviceCpu {
- m_Name: QString
- m_Frequency: QString
- m_MaxFrequency: QString
- m_LogicalCPUNum: int
- m_CPUCoreNum: int
+ setCpuInfo(mapLscpu: QMap<QString, QString>, mapCpuinfo: QMap<QString, QString>, logicalNum: int, coreNum: int)
}
class Common {
+ specialComType: int
+ kSpecialType6: int
}
DeviceCpu --|> Common: uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码是对CPU设备信息处理的diff修改,我来分析一下:
改进建议:
// 在适当的位置定义常量
static const QString SPECIAL_CPU_FREQ_FIX = "2.189";
static const QString SPECIAL_CPU_FREQ_FIXED = "2.188";
static const QString SPECIAL_MAX_FREQ_FIX = "2189";
static const QString SPECIAL_MAX_FREQ_FIXED = "2188";
// 修改代码
if (Common::specialComType == Common::kSpecialType6) {
m_Frequency.replace(SPECIAL_CPU_FREQ_FIX, SPECIAL_CPU_FREQ_FIXED);
m_MaxFrequency.replace(SPECIAL_MAX_FREQ_FIX, SPECIAL_MAX_FREQ_FIXED);
}
// 特殊处理:针对特定型号CPU的频率校准问题
// 当设备类型为kSpecialType6时,需要修正CPU频率显示值
if (Common::specialComType == Common::kSpecialType6) {
m_Frequency.replace("2.189", "2.188");
m_MaxFrequency.replace("2189", "2188");
}
这些改进可以提高代码的可维护性、可读性和灵活性,同时保持代码的安全性。 |
max-lvs
approved these changes
Sep 11, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, max-lvs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
6b2e2cd
into
linuxdeepin:develop/eagle
15 of 17 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modified CPU frequency display for kSpecialType6 devices include current frequency and max frequency to correct hardware reporting inaccuracies.
Log: Fix CPU frequency display for special device type
Task: https://pms.uniontech.com/task-view-381765.html
Change-Id: I3a715b263868c6825ee42941b64a7c5de6a53035
Summary by Sourcery
Adjust CPU frequency display for kSpecialType6 devices to correct hardware reporting inaccuracies
Enhancements: