fixed: drm - physical address detection settled on the first enabled connector - #751
BackSlasher wants to merge 1 commit into
Conversation
…connector Look for a connector that has a valid HDMI address, and not just one that is enabled. On my laptop, the internal panel is also enabled but has no "HDMI vendor block", so parsing the address from it returns 0, which makes libcec fall back to the adapter's defaults. This is despite another output having a completely valid address - the internal panel just comes up first in the `readdir` ordering sometimes. This fix doesn't stop on the first enabled connector, but rather the first one that has a valid address.
|
Thank you for the contribution. Before we can merge it we ask that you accept the Pulse-Eight contributor agreement, which grants us the rights we need to ship your work under every licence libCEC is offered under. I have signed the Pulse-Eight contributor agreement and sent it by email You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
I've signed the Individual Contributor Agreement, but I can't deliver it. Mail to contributor-agreement@pulse-eight.com is rejected:
Sent 2026-09-21 13:19 UTC, Message-ID |
Look for a connector that has a valid HDMI address, and not just one that is enabled.
On my laptop, the internal panel is also enabled but has no "HDMI vendor block", so parsing the address from it returns 0, which makes libcec fall back to the adapter's defaults.
This is despite another output having a completely valid address - the internal panel just comes up first in the
readdirordering sometimes.This fix doesn't stop on the first enabled connector, but rather the first one that has a valid address.
The original early exit was in #262, bailing early rather than crashing on an empty file in #263 (also reported in #147).
The parser is now more robust so this is no longer a risk. The zero-length and short-EDID cases below cover it.
Tested
1.0.0.0, and with this change it registers at3.1.0.0, which matches the EDID. With the panel disabled, both give3.1.0.0./sys/class/drmtrees built from the real panel and HDMI EDIDs, under ASan and UBSan:The scan directory is hardcoded, so the fake test cases needed a small shim. I avoided including it here to keep the change small. I have a follow-up commit that makes the directory a parameter and scans connectors in sorted order.
I also have the test as a dependency-free executable that could be wired into CTest. I'm happy to contribute either if you'd like them.