瀏覽代碼

drm/radeon/kms: rework radeon_dp_detect() logic

If the connector is eDP, it can only be DP, not TMDS.
Always set the detected sink type.  If the sink is
detected as non-DP, but there is no EDID, you can still
manually force the port on.  If the sink type is DP
and there's no DPCD, there's no way to force the monitor
on since you need both ends to train the link.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher 15 年之前
父節點
當前提交
6f50eae75b
共有 1 個文件被更改,包括 11 次插入10 次删除
  1. 11 10
      drivers/gpu/drm/radeon/radeon_connectors.c

+ 11 - 10
drivers/gpu/drm/radeon/radeon_connectors.c

@@ -977,24 +977,25 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto
 	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 	enum drm_connector_status ret = connector_status_disconnected;
 	enum drm_connector_status ret = connector_status_disconnected;
 	struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
 	struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
-	u8 sink_type;
 
 
 	if (radeon_connector->edid) {
 	if (radeon_connector->edid) {
 		kfree(radeon_connector->edid);
 		kfree(radeon_connector->edid);
 		radeon_connector->edid = NULL;
 		radeon_connector->edid = NULL;
 	}
 	}
 
 
-	sink_type = radeon_dp_getsinktype(radeon_connector);
-	if ((sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
-	    (sink_type == CONNECTOR_OBJECT_ID_eDP)) {
-		if (radeon_dp_getdpcd(radeon_connector)) {
-			radeon_dig_connector->dp_sink_type = sink_type;
+	if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+		/* eDP is always DP */
+		radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;
+		if (radeon_dp_getdpcd(radeon_connector))
 			ret = connector_status_connected;
 			ret = connector_status_connected;
-		}
 	} else {
 	} else {
-		if (radeon_ddc_probe(radeon_connector)) {
-			radeon_dig_connector->dp_sink_type = sink_type;
-			ret = connector_status_connected;
+		radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);
+		if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
+			if (radeon_dp_getdpcd(radeon_connector))
+				ret = connector_status_connected;
+		} else {
+			if (radeon_ddc_probe(radeon_connector))
+				ret = connector_status_connected;
 		}
 		}
 	}
 	}