All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Jackson <ajax@redhat.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/7] drm/i915/dp: Retry DPCD fetch on G4X too
Date: Tue, 12 Jul 2011 17:38:04 -0400	[thread overview]
Message-ID: <1310506685-855-7-git-send-email-ajax@redhat.com> (raw)
In-Reply-To: <1310506685-855-1-git-send-email-ajax@redhat.com>

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 13bddd3..9a0c3ca 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1596,10 +1596,22 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 }
 
 static enum drm_connector_status
+i915_dp_detect_common(struct intel_dp *intel_dp)
+{
+	enum drm_connector_status status = connector_status_disconnected;
+
+	if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
+					   sizeof (intel_dp->dpcd)) &&
+	    (intel_dp->dpcd[DP_DPCD_REV] != 0))
+		status = connector_status_connected;
+
+	return status;
+}
+
+static enum drm_connector_status
 ironlake_dp_detect(struct intel_dp *intel_dp)
 {
 	enum drm_connector_status status;
-	bool ret;
 
 	/* Can't disconnect eDP, but you can close the lid... */
 	if (is_edp(intel_dp)) {
@@ -1609,13 +1621,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	status = connector_status_disconnected;
-	ret = intel_dp_aux_native_read_retry(intel_dp,
-					     0x000, intel_dp->dpcd,
-					     sizeof (intel_dp->dpcd));
-	if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0)
-		status = connector_status_connected;
-	return status;
+	return i915_dp_detect_common(intel_dp);
 }
 
 static enum drm_connector_status
@@ -1623,7 +1629,6 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	enum drm_connector_status status;
 	uint32_t temp, bit;
 
 	switch (intel_dp->output_reg) {
@@ -1645,15 +1650,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 	if ((temp & bit) == 0)
 		return connector_status_disconnected;
 
-	status = connector_status_disconnected;
-	if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd,
-				     sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd))
-	{
-		if (intel_dp->dpcd[DP_DPCD_REV] != 0)
-			status = connector_status_connected;
-	}
-
-	return status;
+	return i915_dp_detect_common(intel_dp);
 }
 
 /**
-- 
1.7.6

  parent reply	other threads:[~2011-07-12 21:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 21:37 [PATCH 0/7] Minor DisplayPort cleanup Adam Jackson
2011-07-12 21:37 ` [PATCH 1/7] drm: Fill in more of the DisplayPort DPCD registers Adam Jackson
2011-07-12 22:42   ` Keith Packard
2012-01-17 16:07     ` Daniel Vetter
2011-07-12 21:38 ` [PATCH 2/7] drm/i915/dp: Zero the DPCD data before connection probe Adam Jackson
2011-07-12 21:38 ` [PATCH 3/7] drm/i915/dp: Move DPCD dump to common code instead of PCH-only Adam Jackson
2011-07-12 21:38 ` [PATCH 4/7] drm/i915/dp: Read more DPCD registers on connection probe Adam Jackson
2011-07-12 21:38 ` [PATCH 5/7] drm/i915/dp: Better hexdump of DPCD Adam Jackson
2011-07-12 21:38 ` Adam Jackson [this message]
2011-07-12 21:38 ` [PATCH 7/7] drm/i915/dp: Explicitly request 8/10 channel coding Adam Jackson
2011-07-12 22:43   ` Keith Packard

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=1310506685-855-7-git-send-email-ajax@redhat.com \
    --to=ajax@redhat.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.