Patchwork [Oneiric,1/2] drm/radeon/kms: fix dp_detect handling for DP bridge chips

login
register
mail settings
Submitter Jesse Sung
Date Feb. 16, 2012, 8:41 a.m.
Message ID <5ed94c51e1e3a8e6e77601d239b265468de88b9d.1329290089.git.jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/141520/
State New
Headers show

Comments

Jesse Sung - Feb. 16, 2012, 8:41 a.m.
BugLink: http://bugs.launchpad.net/bugs/825777

The HPD pin is not reliable for detecting whether a monitor
is connected or not.  Skip HPD and just use DDC or load
detection.

Fixes phantom VGA connected bugs.

[Michel: fixes phantom VGA bugs on his llano system.]

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 6777a4f6898a53974ef7fe7ce09ec41fae0f32db)
Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 9eec292..800eadf 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -1315,23 +1315,14 @@  radeon_dp_detect(struct drm_connector *connector, bool force)
 		/* get the DPCD from the bridge */
 		radeon_dp_getdpcd(radeon_connector);
 
-		if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
-			ret = connector_status_connected;
-		else {
-			/* need to setup ddc on the bridge */
-			if (encoder)
-				radeon_atom_ext_encoder_setup_ddc(encoder);
+		if (encoder) {
+			/* setup ddc on the bridge */
+			radeon_atom_ext_encoder_setup_ddc(encoder);
 			if (radeon_ddc_probe(radeon_connector,
-					     radeon_connector->requires_extended_probe))
+					     radeon_connector->requires_extended_probe)) /* try DDC */
 				ret = connector_status_connected;
-		}
-
-		if ((ret == connector_status_disconnected) &&
-		    radeon_connector->dac_load_detect) {
-			struct drm_encoder *encoder = radeon_best_single_encoder(connector);
-			struct drm_encoder_helper_funcs *encoder_funcs;
-			if (encoder) {
-				encoder_funcs = encoder->helper_private;
+			else if (radeon_connector->dac_load_detect) { /* try load detection */
+				struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
 				ret = encoder_funcs->detect(encoder, connector);
 			}
 		}