public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Todd Previte <tprevite@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/5] drm/i915: Displayport - Add function to execute a single iteration of channel equalization
Date: Tue,  8 Apr 2014 10:47:43 -0700	[thread overview]
Message-ID: <1396979263-3245-6-git-send-email-tprevite@gmail.com> (raw)
In-Reply-To: <1396979263-3245-1-git-send-email-tprevite@gmail.com>

Adds a function to execute a single iteration of the channel equalization
sequence for Displayport. This is functionality required to establish more
fine-grained control over the Displayport interface, both for operational
reliability and compliance testing.

Signed-off-by: Todd Previte <tprevite@gmail.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6baa26c..66dbda6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2878,6 +2878,37 @@ exit:
 	return clock_recovery_status;
 }
 
+uint32_t intel_dp_exec_channel_equalization(struct intel_dp *intel_dp)
+{
+	uint32_t channel_equalization_status = DP_CHANNEL_EQUALIZATION_FAILED;
+	uint8_t link_status[DP_LINK_STATUS_SIZE];
+
+	// Set the correct training pattern
+	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x12)
+		intel_dp_set_training_pattern(DP_TRAINING_PATTERN_2, intel_dp); 
+	else
+		intel_dp_set_training_pattern(DP_TRAINING_PATTERN_2, intel_dp); 
+
+	// Wait for channel equalization time period to expire
+	drm_dp_link_train_channel_eq_delay(intel_dp->dpcd);
+
+	// Check link status
+	if (!intel_dp_get_link_status(intel_dp, link_status)) {
+		channel_equalization_status = DP_LINK_STATUS_READ_FAILED;
+		goto exit;
+	}
+
+	// Verify that both CR is still valid and CE is successful
+	if (intel_dp_verify_link_status(DP_LINK_TRAINING_STATE_CLOCK_REC,
+									intel_dp->lane_count, link_status) &&
+		intel_dp_verify_link_status(DP_LINK_TRAINING_STATE_CHANNEL_EQ,
+									intel_dp->lane_count, link_status))
+			channel_equalization_status = DP_CHANNEL_EQUALIZATION_COMPLETE;
+
+exit:
+	return channel_equalization_status;
+}
+
 static void
 intel_dp_link_down(struct intel_dp *intel_dp)
 {
-- 
1.8.3.2

  parent reply	other threads:[~2014-04-08 17:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 17:47 [PATCH 0/5] RFC: Displayport Link Policy Maker Update Todd Previte
2014-04-08 17:47 ` [PATCH 1/5] dmr/i915: Displayport - Add a function to set the training pattern Todd Previte
2014-04-08 19:52   ` Paulo Zanoni
2014-04-08 17:47 ` [PATCH 2/5] drm/i915: Displayport - Add function to check link status Todd Previte
2014-04-08 17:47 ` [PATCH 3/5] drm/i915: Displayport - Add function to enable/disable scrambling on the main link Todd Previte
2014-04-08 17:47 ` [PATCH 4/5] drm/i915: Displayport - Add function for executing a single iteration of clock recovery Todd Previte
2014-04-08 17:47 ` Todd Previte [this message]
2014-04-09 13:26 ` [PATCH 0/5] RFC: Displayport Link Policy Maker Update Daniel Vetter

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=1396979263-3245-6-git-send-email-tprevite@gmail.com \
    --to=tprevite@gmail.com \
    --cc=intel-gfx@lists.freedesktop.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