]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Determine DVI-I connector type (v2)
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 26 Sep 2025 18:01:41 +0000 (20:01 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Oct 2025 13:59:30 +0000 (09:59 -0400)
DC determines the DRM connector type based on the
signal type, which becomes problematic when a connector may
support different signal types, such as DVI-I.
With this patch, it is now determined according to the actual
connector type for DVI-D and DVI-I connectors.

Also set the HPD (hotplug detection) flag for DVI-I connectors
to prevent regressing their digital functionality, which has
been already working.

A subsequent commit will also implement polling for DVI-I.

v2:
Only use connector type for DVI to prevent regressions
for other signal types.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 5b446e4000efeb249351df1a7a74da0909832924..9e260ca04e1ee6de1e56113f2a18834cec531ff5 100644 (file)
@@ -8263,7 +8263,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,
        return 0;
 }
 
-static int to_drm_connector_type(enum signal_type st)
+static int to_drm_connector_type(enum signal_type st, uint32_t connector_id)
 {
        switch (st) {
        case SIGNAL_TYPE_HDMI_TYPE_A:
@@ -8279,6 +8279,10 @@ static int to_drm_connector_type(enum signal_type st)
                return DRM_MODE_CONNECTOR_DisplayPort;
        case SIGNAL_TYPE_DVI_DUAL_LINK:
        case SIGNAL_TYPE_DVI_SINGLE_LINK:
+               if (connector_id == CONNECTOR_ID_SINGLE_LINK_DVII ||
+                       connector_id == CONNECTOR_ID_DUAL_LINK_DVII)
+                       return DRM_MODE_CONNECTOR_DVII;
+
                return DRM_MODE_CONNECTOR_DVID;
        case SIGNAL_TYPE_VIRTUAL:
                return DRM_MODE_CONNECTOR_VIRTUAL;
@@ -8668,6 +8672,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
                        link->link_enc->features.dp_ycbcr420_supported ? true : false;
                break;
        case DRM_MODE_CONNECTOR_DVID:
+       case DRM_MODE_CONNECTOR_DVII:
                aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
                break;
        default:
@@ -8871,7 +8876,7 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
                goto out_free;
        }
 
-       connector_type = to_drm_connector_type(link->connector_signal);
+       connector_type = to_drm_connector_type(link->connector_signal, link->link_id.id);
 
        res = drm_connector_init_with_ddc(
                        dm->ddev,