diff mbox

[1/5] drm/i915: Handle automated test requests for short pulse hpd

Message ID 1461572670-32421-1-git-send-email-shubhangi.shrivastava@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shubhangi Shrivastava April 25, 2016, 8:24 a.m. UTC
This patch adds support for automated test requests during
short pulse handling in gen platforms.

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 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 7df17d12..1b26c59 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4074,7 +4074,8 @@  static uint8_t intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp)
 	return test_result;
 }
 
-static void intel_dp_handle_test_request(struct intel_dp *intel_dp)
+static void intel_dp_handle_test_request(struct intel_dp *intel_dp,
+					 bool short_pulse)
 {
 	uint8_t response = DP_TEST_NAK;
 	uint8_t rxdata = 0;
@@ -4086,6 +4087,11 @@  static void intel_dp_handle_test_request(struct intel_dp *intel_dp)
 		goto update_status;
 	}
 
+	if (short_pulse && rxdata != DP_TEST_LINK_TRAINING) {
+		DRM_ERROR("Invalid test request in short pulse\n");
+		goto update_status;
+	}
+
 	switch (rxdata) {
 	case DP_TEST_LINK_TRAINING:
 		DRM_DEBUG_KMS("LINK_TRAINING test requested\n");
@@ -4258,7 +4264,7 @@  intel_dp_short_pulse(struct intel_dp *intel_dp)
 				   sink_irq_vector);
 
 		if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST)
-			DRM_DEBUG_DRIVER("Test request in short pulse not handled\n");
+			intel_dp_handle_test_request(intel_dp, true);
 		if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ))
 			DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
 	}
@@ -4612,7 +4618,7 @@  intel_dp_long_pulse(struct intel_connector *intel_connector)
 				   sink_irq_vector);
 
 		if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST)
-			intel_dp_handle_test_request(intel_dp);
+			intel_dp_handle_test_request(intel_dp, false);
 		if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ))
 			DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
 	}