AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Wenjing Liu <Wenjing.Liu-5C7GfCeVMHo@public.gmane.org>,
	Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 2/2] drm/amd/display: Retry link training at verify_link_cap stage
Date: Thu, 14 Jun 2018 13:43:32 -0400	[thread overview]
Message-ID: <20180614174332.19159-2-harry.wentland@amd.com> (raw)
In-Reply-To: <20180614174332.19159-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>

Some receivers seem to fail the first link training but are on good on
subsequent tries. Set a limit of 2 retries for each level before falling
back.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
CC: Wenjing Liu <Wenjing.Liu@amd.com>
---
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 28 +++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 72a8a55565c8..037d3bcfc2cc 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -31,7 +31,14 @@ enum {
 	/* to avoid infinite loop where-in the receiver
 	 * switches between different VS
 	 */
-	LINK_TRAINING_MAX_CR_RETRY = 100
+	LINK_TRAINING_MAX_CR_RETRY = 100,
+	/*
+	 * Some receivers fail to train on first try and are good
+	 * on subsequent tries. 2 retries should be plenty. If we
+	 * don't have a successful training then we don't expect to
+	 * ever get one.
+	 */
+	LINK_TRAINING_MAX_VERIFY_RETRY = 2
 };
 
 static bool decide_fallback_link_setting(
@@ -1142,15 +1149,20 @@ bool dp_hbr_verify_link_cap(
 				cur);
 
 
-		if (skip_link_training)
+		if (skip_link_training) {
 			success = true;
-		else {
-			status = dc_link_dp_perform_link_training(
-							link,
-							cur,
+		} else {
+			int i;
+
+			for (i = 0; i < LINK_TRAINING_MAX_VERIFY_RETRY; i++) {
+				status = dc_link_dp_perform_link_training(
+							link, cur,
 							skip_video_pattern);
-			if (status == LINK_TRAINING_SUCCESS)
-				success = true;
+				if (status == LINK_TRAINING_SUCCESS) {
+					success = true;
+					break;
+				}
+			}
 		}
 
 		if (success)
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-06-14 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 17:43 [PATCH 1/2] drm/amd/display: Bring back dc_log for more debug prints Harry Wentland
     [not found] ` <20180614174332.19159-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-06-14 17:43   ` Harry Wentland [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180614174332.19159-2-harry.wentland@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=Wenjing.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox