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 4/8] drm/i915: Move Displayport test request and sink IRQ logic to intel_dp_detect()
Date: Mon, 20 Apr 2015 15:27:34 -0700	[thread overview]
Message-ID: <1429568854-21045-1-git-send-email-tprevite@gmail.com> (raw)
In-Reply-To: <1429340659-14369-2-git-send-email-tprevite@gmail.com>

Due to changes in the driver and to support Displayport compliance testing,
the test request and sink IRQ logic has been relocated from
intel_dp_check_link_status to intel_dp_detect. This is because the bulk of the
compliance tests that set the TEST_REQUEST bit in the DEVICE_IRQ field of the
DPCD issue a long pulse / hot plug event to signify the start of the test.
Currently, for a long pulse, intel_dp_check_link_status is not called for a
long HPD pulse, so if test requests come in, they cannot be detected by the
driver.

Once located in the intel_dp_detect, in the regular hot plug event path,
proper detection of Displayport compliance test requests occurs which then
invokes the test handler to support them. Additionally, this places compliance
testing in the normal operational paths, eliminating as much special case code
as possible.

The only change in intel_dp_check_link_status with this patch is that when
the IRQ is the result of a test request from the sink, the test handler is not
invoked during the short pulse path. Short pulse test requests are for a
particular variety of tests (mainly link training) that will be implemented
in the future. Once those tests are available, the test request handler will
be called from here as well.

V1:
- Rewored the commit message to be more clear about the content and intent
  of this patch
- Restore IRQ detection logic to intel_dp_check_link_status(). Continue to
  detect and clear sink IRQs in the short pulse case. Ignore test requests
  in the short pulses for now since they are for future test implementations.

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

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2ef05d7..b249ee8 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4156,7 +4156,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 				   sink_irq_vector);
 
 		if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST)
-			intel_dp_handle_test_request(intel_dp);
+			DRM_DEBUG_DRIVER("Test request in short pulse not handled\n");
 		if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ))
 			DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
 	}
@@ -4386,6 +4386,7 @@ intel_dp_detect(struct drm_connector *connector, bool force)
 	enum drm_connector_status status;
 	enum intel_display_power_domain power_domain;
 	bool ret;
+	u8 sink_irq_vector;
 
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
 		      connector->base.id, connector->name);
@@ -4428,6 +4429,20 @@ intel_dp_detect(struct drm_connector *connector, bool force)
 		intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
 	status = connector_status_connected;
 
+	/* Try to read the source of the interrupt */
+	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
+	    intel_dp_get_sink_irq(intel_dp, &sink_irq_vector)) {
+		/* Clear interrupt source */
+		drm_dp_dpcd_writeb(&intel_dp->aux,
+				   DP_DEVICE_SERVICE_IRQ_VECTOR,
+				   sink_irq_vector);
+
+		if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST)
+			intel_dp_handle_test_request(intel_dp);
+		if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ))
+			DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n");
+	}
+
 out:
 	intel_dp_power_put(intel_dp, power_domain);
 	return status;
-- 
1.9.1

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

  parent reply	other threads:[~2015-04-20 22:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18  7:04 [PATCH V7] Displayport compliance testing V7 Todd Previte
2015-04-18  7:04 ` [PATCH 1/5] drm/i915: Move Displayport test request and sink IRQ logic to intel_dp_detect() Todd Previte
2015-04-19 23:09   ` [PATCH] " Todd Previte
2015-04-20  2:01     ` shuang.he
2015-04-20 22:27   ` Todd Previte [this message]
2015-04-30 18:14     ` [PATCH 4/8] " Paulo Zanoni
2015-04-18  7:04 ` [PATCH 2/5] drm: Add edid_corrupt flag for Displayport Link CTS 4.2.2.6 Todd Previte
2015-04-21 18:09   ` Todd Previte
2015-04-22 20:20     ` Alex Deucher
2015-04-30 18:37       ` Paulo Zanoni
2015-05-08 14:13     ` [PATCH] drm: Fix missing kerneldoc for the edid_corrupt field in struct drm_connector Todd Previte
2015-05-09  1:59       ` shuang.he
2015-05-11  9:43       ` Daniel Vetter
2015-04-18  7:04 ` [PATCH 3/5] drm/i915: Implement the intel_dp_autotest_edid function for DP EDID complaince tests Todd Previte
2015-04-30 18:30   ` Paulo Zanoni
2015-05-04 13:17     ` Daniel Vetter
2015-05-05 13:50       ` Jani Nikula
2015-05-04 14:48   ` [PATCH 06/10] " Todd Previte
2015-05-07  7:35     ` Daniel Vetter
2015-04-18  7:04 ` [PATCH 4/5] drm: Fix for DP CTS test 4.2.2.5 - I2C DEFER handling Todd Previte
2015-04-20 16:30   ` Daniel Vetter
2015-04-18  7:04 ` [PATCH 5/5] drm/i915: Add debugfs test control files for Displayport compliance testing Todd Previte
2015-04-23 21:35   ` shuang.he

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=1429568854-21045-1-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