Commit 97010d77 authored by Timur Kristóf's avatar Timur Kristóf Committed by Alex Deucher
Browse files

drm/amd/display: Determine DVI-I connector type (v2)



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: default avatarTimur Kristóf <timur.kristof@gmail.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f18719ef
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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,