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 <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++--
 1 file changed, 7 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 20ab9fd1b82a..4a9109818672 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8133,7 +8133,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:
@@ -8149,6 +8149,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;
@@ -8538,6 +8542,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:
@@ -8741,7 +8746,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,
-- 
2.51.0

Reply via email to