From 57cdaf0797f94578194bc8c915d06448aadfa2a1 Mon Sep 17 00:00:00 2001 From: Nitzan Raz Date: Mon, 21 Sep 2026 14:52:07 +0300 Subject: [PATCH] fixed: drm - physical address detection settled on the first enabled 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. --- src/libcec/platform/drm/drm-edid.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcec/platform/drm/drm-edid.cpp b/src/libcec/platform/drm/drm-edid.cpp index 8c7cdb35..a4afcc5f 100644 --- a/src/libcec/platform/drm/drm-edid.cpp +++ b/src/libcec/platform/drm/drm-edid.cpp @@ -85,7 +85,11 @@ uint16_t CDRMEdidParser::GetPhysicalAddress(void) if (edid.is_open()) { if (edid.good()) { - enablededid = edidPath; + // We look if it contains a valid physical address + char data[4096]; + edid.read(data, sizeof(data)); + if (CEDIDParser::GetPhysicalAddressFromEDID(data, (size_t)edid.gcount()) != 0) + enablededid = edidPath; } edid.close(); }