If an EDID override is in effect (e.g. via debugfs edid_override or
drm.edid_firmware kernel parameter), the overriding EDID may not
advertise capabilities matching the physical connector being used.
In that case, trust the physical connector type over the EDID in
create_eml_sink() and dm_helpers_parse_edid_caps().

Signed-off-by: Johannes Wüller <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c        | 9 ++++++++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c    | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ff09a5371cb2..bc853f7555a9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7911,7 +7911,14 @@ static void create_eml_sink(struct amdgpu_dm_connector 
*aconnector)
                return;
        }
 
-       if (connector->display_info.is_hdmi)
+       /*
+        * If an EDID override is active, it may not advertise HDMI capability
+        * even though the physical connector is HDMI. Trust the connector type.
+        */
+       if (connector->display_info.is_hdmi ||
+           (connector->edid_overridden &&
+            (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+             connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)))
                init_params.sink_signal = SIGNAL_TYPE_HDMI_TYPE_A;
 
        aconnector->drm_edid = drm_edid;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index d7b0b84b3865..36b6e37f1517 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -137,7 +137,14 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
                                  edid_caps->display_name,
                                  AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
 
-       edid_caps->edid_hdmi = connector->display_info.is_hdmi;
+       /*
+        * If an EDID override is active, it may not advertise HDMI capability
+        * even though the physical connector is HDMI. Trust the connector type.
+        */
+       edid_caps->edid_hdmi = connector->display_info.is_hdmi ||
+               (connector->edid_overridden &&
+                (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+                 connector->connector_type == DRM_MODE_CONNECTOR_HDMIB));
 
        if (edid_caps->edid_hdmi)
                
populate_hdmi_info_from_connector(&connector->display_info.hdmi, edid_caps);
-- 
2.53.0

Reply via email to