diff mbox

[Quantal] UBUNTU: SAUCE: i915_hsw: don't send DP "idle" pattern before "normal" on HSW PORT_A

Message ID 1362530775-19826-1-git-send-email-james.leddy@canonical.com
State New
Headers show

Commit Message

James M. Leddy March 6, 2013, 12:46 a.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

To the OEMs, IHVs, and eventually end users, this message is
scary. The reason is because this is written every time a laptop
resumes, so if the driver fails for some other reason, then this is
the only message you see.

Buglink: https://bugs.launchpad.net/bugs/1138700

cherry-picked-from: 10aa17c86f0de1fd902f7b8ee487a3682d7401df

Original commit message follows:

The DP_TP_STATUS register for PORT_A doesn't exist. Our documentation
will be fixed soon, so the code does not match it for now.

This solves "Timed out waiting for DP idle patterns" and "unclaimed
register" messages on eDP.

V1: Was called "drm/i915: don't read DP_TP_STATUS(PORT_A)"
V2: Was called "drm/i915: don't send DP idle pattern before normal
pattern on HSW"
V3: Only change the code that touches PORT_A.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: James M Leddy <james.leddy@canonical.com>
---
 ubuntu/i915/intel_dp.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Stefan Bader March 6, 2013, 10:38 a.m. UTC | #1
On 06.03.2013 01:46, James M Leddy wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> To the OEMs, IHVs, and eventually end users, this message is
> scary. The reason is because this is written every time a laptop
> resumes, so if the driver fails for some other reason, then this is
> the only message you see.
> 
> Buglink: https://bugs.launchpad.net/bugs/1138700
> 
> cherry-picked-from: 10aa17c86f0de1fd902f7b8ee487a3682d7401df
> 
> Original commit message follows:
> 
> The DP_TP_STATUS register for PORT_A doesn't exist. Our documentation
> will be fixed soon, so the code does not match it for now.
> 
> This solves "Timed out waiting for DP idle patterns" and "unclaimed
> register" messages on eDP.
> 
> V1: Was called "drm/i915: don't read DP_TP_STATUS(PORT_A)"
> V2: Was called "drm/i915: don't send DP idle pattern before normal
> pattern on HSW"
> V3: Only change the code that touches PORT_A.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: James M Leddy <james.leddy@canonical.com>
> ---
>  ubuntu/i915/intel_dp.c |   16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/ubuntu/i915/intel_dp.c b/ubuntu/i915/intel_dp.c
> index 295d21e..f46d47b 100644
> --- a/ubuntu/i915/intel_dp.c
> +++ b/ubuntu/i915/intel_dp.c
> @@ -1697,14 +1697,18 @@ intel_dp_set_link_train(struct intel_dp *intel_dp,
>  		temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
>  		switch (dp_train_pat & DP_TRAINING_PATTERN_MASK) {
>  		case DP_TRAINING_PATTERN_DISABLE:
> -			temp |= DP_TP_CTL_LINK_TRAIN_IDLE;
> -			I915_WRITE(DP_TP_CTL(port), temp);
>  
> -			if (wait_for((I915_READ(DP_TP_STATUS(port)) &
> -				      DP_TP_STATUS_IDLE_DONE), 1))
> -				DRM_ERROR("Timed out waiting for DP idle patterns\n");
> +			if (port != PORT_A) {
> +				temp |= DP_TP_CTL_LINK_TRAIN_IDLE;
> +				I915_WRITE(DP_TP_CTL(port), temp);
> +
> +				if (wait_for((I915_READ(DP_TP_STATUS(port)) &
> +					      DP_TP_STATUS_IDLE_DONE), 1))
> +					DRM_ERROR("Timed out waiting for DP idle patterns\n");
> +
> +				temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
> +			}
>  
> -			temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
>  			temp |= DP_TP_CTL_LINK_TRAIN_NORMAL;
>  
>  			break;
> 
Simple cherry pick, seems to be doing what it claims.
Tim Gardner March 6, 2013, 12:34 p.m. UTC | #2
The original commit did not apply, but the emailed patch did. I updated 
the commit log to indicate this was a back port as it appears to be correct.
James M. Leddy March 6, 2013, 5:38 p.m. UTC | #3
On 03/06/2013 07:34 AM, Tim Gardner wrote:
> The original commit did not apply, but the emailed patch did. I updated
> the commit log to indicate this was a back port as it appears to be
> correct.

My fault, it wasn't a cherry-pick, but a backport to deal with the move
of i915 to ./ubuntu
diff mbox

Patch

diff --git a/ubuntu/i915/intel_dp.c b/ubuntu/i915/intel_dp.c
index 295d21e..f46d47b 100644
--- a/ubuntu/i915/intel_dp.c
+++ b/ubuntu/i915/intel_dp.c
@@ -1697,14 +1697,18 @@  intel_dp_set_link_train(struct intel_dp *intel_dp,
 		temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
 		switch (dp_train_pat & DP_TRAINING_PATTERN_MASK) {
 		case DP_TRAINING_PATTERN_DISABLE:
-			temp |= DP_TP_CTL_LINK_TRAIN_IDLE;
-			I915_WRITE(DP_TP_CTL(port), temp);
 
-			if (wait_for((I915_READ(DP_TP_STATUS(port)) &
-				      DP_TP_STATUS_IDLE_DONE), 1))
-				DRM_ERROR("Timed out waiting for DP idle patterns\n");
+			if (port != PORT_A) {
+				temp |= DP_TP_CTL_LINK_TRAIN_IDLE;
+				I915_WRITE(DP_TP_CTL(port), temp);
+
+				if (wait_for((I915_READ(DP_TP_STATUS(port)) &
+					      DP_TP_STATUS_IDLE_DONE), 1))
+					DRM_ERROR("Timed out waiting for DP idle patterns\n");
+
+				temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
+			}
 
-			temp &= ~DP_TP_CTL_LINK_TRAIN_MASK;
 			temp |= DP_TP_CTL_LINK_TRAIN_NORMAL;
 
 			break;