All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
Subject: [PATCH 2/5] drm/i915: Read test values for lane_count and link_rate
Date: Mon, 25 Apr 2016 13:54:27 +0530	[thread overview]
Message-ID: <1461572670-32421-2-git-send-email-shubhangi.shrivastava@intel.com> (raw)
In-Reply-To: <1461572670-32421-1-git-send-email-shubhangi.shrivastava@intel.com>

During automated test request for link training we are supposed to
read the TEST_LANE_COUNT and TEST_LINK_RATE dpcd registers and use
respective values in the next link training. This patch adds
reading and updating of these values.

Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1b26c59..387800b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4010,9 +4010,34 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)
 	return true;
 }
 
+/*
+ * This function reads TEST_LANE_COUNT & TEST_LINK_RATE and updates
+ * them to cached dpcd values, thus the new values are implicitly
+ * used by rest of the code without need to be aware of the change.
+ */
 static uint8_t intel_dp_autotest_link_training(struct intel_dp *intel_dp)
 {
 	uint8_t test_result = DP_TEST_ACK;
+	uint8_t dpcd_val, ret;
+
+	ret = drm_dp_dpcd_read(&intel_dp->aux,
+			       DP_TEST_LANE_COUNT,
+			       &dpcd_val, 1);
+
+	/* update values only if read returned 1 byte */
+	if (ret == 1) {
+		dpcd_val &= DP_MAX_LANE_COUNT_MASK;
+		intel_dp->dpcd[DP_MAX_LANE_COUNT] &= ~(DP_MAX_LANE_COUNT_MASK);
+		intel_dp->dpcd[DP_MAX_LANE_COUNT] |= dpcd_val;
+	}
+
+	ret = drm_dp_dpcd_read(&intel_dp->aux,
+			       DP_TEST_LINK_RATE,
+			       &dpcd_val, 1);
+
+	if (ret == 1)
+		intel_dp->dpcd[DP_MAX_LINK_RATE] = dpcd_val;
+
 	return test_result;
 }
 
-- 
2.6.1

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

  reply	other threads:[~2016-04-25  8:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25  8:24 [PATCH 1/5] drm/i915: Handle automated test requests for short pulse hpd Shubhangi Shrivastava
2016-04-25  8:24 ` Shubhangi Shrivastava [this message]
2016-04-26  4:09   ` [PATCH 2/5] drm/i915: Read test values for lane_count and link_rate Navare, Manasi D
2016-05-02  9:08     ` Shubhangi Shrivastava
2016-05-02  9:16       ` Thulasimani, Sivakumar
2016-04-25  8:24 ` [PATCH 3/5] drm/i915: Cleanup panel IRQ handling Shubhangi Shrivastava
2016-04-25  8:24 ` [PATCH 4/5] drm/i915: Extract test reply to separate function Shubhangi Shrivastava
2016-04-25  8:24 ` [PATCH 5/5] drm/i915: Delay acknowledging of link training for ATR Shubhangi Shrivastava
2016-04-25 10:21 ` ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915: Handle automated test requests for short pulse hpd Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-04-21  8:40 [PATCH 1/5] " Shubhangi Shrivastava
2016-04-21  8:40 ` [PATCH 2/5] drm/i915: Read test values for lane_count and link_rate Shubhangi Shrivastava

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=1461572670-32421-2-git-send-email-shubhangi.shrivastava@intel.com \
    --to=shubhangi.shrivastava@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.