Fix: The monitor's screen size is incorrect.#624
Conversation
Reviewer's GuideRefines EDID parsing for monitor size and error handling by clarifying endian-specific validation messages, correcting Detailed Timing parsing for both endian modes, removing redundant screen size recomputation logic, and making EDID parsing failures in CommonTools visible and non-fatal for the overall parsing loop. Sequence diagram for EDID parsing with improved error handlingsequenceDiagram
participant CommonTools
participant EDIDParser
participant Logger
CommonTools->>CommonTools: parseEDID(allEDIDS, input, isHW)
loop for each edidStr in allEDIDS
CommonTools->>EDIDParser: setEdid(edidStr, errorMsg, separator, needLittleEndian)
alt setEdid returns false
EDIDParser-->>CommonTools: false, errorMsg
CommonTools->>Logger: qCritical(errorMsg)
CommonTools->>CommonTools: continue to next edidStr
else setEdid returns true
EDIDParser-->>CommonTools: true
CommonTools->>CommonTools: build mapInfo from EDIDParser
end
end
Updated class diagram for EDIDParser and CommonToolsclassDiagram
class EDIDParser {
-bool m_LittleEndianMode
-int m_Width
-int m_Height
+bool setEdid(QString edid, QString errorMsg, QString separator, bool needLittleEndian)
+void parseReleaseDate()
+void parseScreenSize()
+QString vendor()
-QString getBytes(int lineIndex, int byteIndex)
-QString hexToDec(QString hexValue)
}
class CommonTools {
+static void parseEDID(QStringList allEDIDS, QString input, bool isHW)
}
CommonTools ..> EDIDParser : uses
class Common {
<<static>> int specialComType
<<static>> int kSpecialType7
}
EDIDParser ..> Common : reads
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note
详情{
"deepin-devicemanager/src/Tool/commontools.cpp": [
{
"line": " return \"https://driver.uniontech.com/api/v1/drive/search\";",
"line_number": 165,
"rule": "S35",
"reason": "Url link | 162cef9d4a"
},
{
"line": " return \"https://driver.uniontech.com/api/v1/drive/search\";",
"line_number": 169,
"rule": "S35",
"reason": "Url link | 162cef9d4a"
},
{
"line": " return \"https://drive-pre.uniontech.com/api/v1/drive/search\";",
"line_number": 171,
"rule": "S35",
"reason": "Url link | 0e010283c1"
}
]
} |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
EDIDParser::parseScreenSize, the new big-endian branch mixes variable names and comments (e.g.,tmpwis documented as the original height byte andtmphas the original width byte); aligning names and comments with their actual semantic meaning would make this logic much easier to maintain and verify. - The new
qCritical()log inCommonTools::parseEDIDwill fire for every invalid EDID; if this function is called on large batches of monitors, consider lowering the log level or adding some deduplication/context so logs don’t become excessively noisy.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `EDIDParser::parseScreenSize`, the new big-endian branch mixes variable names and comments (e.g., `tmpw` is documented as the original height byte and `tmph` as the original width byte); aligning names and comments with their actual semantic meaning would make this logic much easier to maintain and verify.
- The new `qCritical()` log in `CommonTools::parseEDID` will fire for every invalid EDID; if this function is called on large batches of monitors, consider lowering the log level or adding some deduplication/context so logs don’t become excessively noisy.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
-- For some monitors, detailed size information is not recorded in the EDID file; in such cases, obtaining the basic size information is sufficient. -- Therefore, remove the logic that retrieves the detailed size information again. Log: fix issue Bug: https://pms.uniontech.com/bug-view-354275.html
7ba3847 to
b2d32a6
Compare
|
Note
详情{
"deepin-devicemanager/src/Tool/commontools.cpp": [
{
"line": " return \"https://driver.uniontech.com/api/v1/drive/search\";",
"line_number": 165,
"rule": "S35",
"reason": "Url link | 162cef9d4a"
},
{
"line": " return \"https://driver.uniontech.com/api/v1/drive/search\";",
"line_number": 169,
"rule": "S35",
"reason": "Url link | 162cef9d4a"
},
{
"line": " return \"https://drive-pre.uniontech.com/api/v1/drive/search\";",
"line_number": 171,
"rule": "S35",
"reason": "Url link | 0e010283c1"
}
]
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, 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 |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
35bc306
into
linuxdeepin:develop/eagle
-- For some monitors, detailed size information is not recorded in the EDID file;
in such cases, obtaining the basic size information is sufficient.
-- Therefore, remove the logic that retrieves the detailed size information again.
Log: fix issue
Bug: https://pms.uniontech.com/bug-view-354275.html
Summary by Sourcery
Correct monitor screen size parsing from EDID data and improve error handling for invalid EDID blocks.
Bug Fixes:
Enhancements: