-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Adjust CPU frequency values for specific device type #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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");
}
这些改进可以提高代码的可维护性、可读性和灵活性,同时保持代码的安全性。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
6b2e2cd
into
linuxdeepin:develop/eagle
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: