[Intel-gfx] [PATCH] drm/i915: enable edp vdd in intel_dp_detect

Daniel Vetter daniel.vetter at ffwll.ch
Mon Jun 11 09:12:31 CEST 2012


We need this for dp aux communication. This issue can fill the dmesg
with WARN spam when the panel is disable (e.g. while reconfiguring the
mode or while resuming).

v2: Actually enable edp vdd early enough. I've missed one dp aux
channel thingy ...

v3: We also enable/disable vdd in get_edid, which is called from
withing ->detect if a monitor is connected. But because we do some
more dp aux transfers afterwards, vdd is actually off and we hit the
WARN again. Hence move vdd enabling/disabling out of get_edid into the
callsite.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50808
Reported-by: Linus Torvalds <torvalds at linux-foundation.org>
Bugreport: http://permalink.gmane.org/gmane.comp.video.dri.devel/69695
Tested-by: Yang Guang <guang.a.yang at intel.com>
Cc: stable at vger.kernel.org
Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/gpu/drm/i915/intel_dp.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 296cfc2..941edbf 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2114,13 +2114,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 static struct edid *
 intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 {
-	struct intel_dp *intel_dp = intel_attached_dp(connector);
-	struct edid	*edid;
-
-	ironlake_edp_panel_vdd_on(intel_dp);
-	edid = drm_get_edid(connector, adapter);
-	ironlake_edp_panel_vdd_off(intel_dp, false);
-	return edid;
+	return drm_get_edid(connector, adapter);
 }
 
 static int
@@ -2152,6 +2146,7 @@ intel_dp_detect(struct drm_connector *connector, bool force)
 
 	intel_dp->has_audio = false;
 
+	ironlake_edp_panel_vdd_on(intel_dp);
 	if (HAS_PCH_SPLIT(dev))
 		status = ironlake_dp_detect(intel_dp);
 	else
@@ -2162,8 +2157,10 @@ intel_dp_detect(struct drm_connector *connector, bool force)
 		      intel_dp->dpcd[3], intel_dp->dpcd[4], intel_dp->dpcd[5],
 		      intel_dp->dpcd[6], intel_dp->dpcd[7]);
 
-	if (status != connector_status_connected)
+	if (status != connector_status_connected) {
+		ironlake_edp_panel_vdd_off(intel_dp, false);
 		return status;
+	}
 
 	intel_dp_probe_oui(intel_dp);
 
@@ -2177,6 +2174,7 @@ intel_dp_detect(struct drm_connector *connector, bool force)
 			kfree(edid);
 		}
 	}
+	ironlake_edp_panel_vdd_off(intel_dp, false);
 
 	return connector_status_connected;
 }
@@ -2235,6 +2233,7 @@ intel_dp_detect_audio(struct drm_connector *connector)
 	struct edid *edid;
 	bool has_audio = false;
 
+	ironlake_edp_panel_vdd_on(intel_dp);
 	edid = intel_dp_get_edid(connector, &intel_dp->adapter);
 	if (edid) {
 		has_audio = drm_detect_monitor_audio(edid);
@@ -2242,6 +2241,7 @@ intel_dp_detect_audio(struct drm_connector *connector)
 		connector->display_info.raw_edid = NULL;
 		kfree(edid);
 	}
+	ironlake_edp_panel_vdd_off(intel_dp, false);
 
 	return has_audio;
 }
-- 
1.7.10




More information about the Intel-gfx mailing list