From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH v2] drm/i915/dp: move intel_dp_aux_native_read_retry() near other reads
Date: Thu, 30 Jan 2014 14:00:59 +0200 [thread overview]
Message-ID: <1391083259-2388-1-git-send-email-jani.nikula@intel.com> (raw)
In-Reply-To: <12da2e573b0a7803f751d2af3e53d6db85c9f95b.1391074436.git.jani.nikula@intel.com>
Just code shuffling to have intel_dp_aux_native_read_retry() next to its
sibling intel_dp_aux_native_read(). No functional changes.
v2: rebase.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 48 +++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 8c61fce..4d04507 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -662,6 +662,30 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
recv, recv_bytes) == recv_bytes;
}
+/*
+ * Native read with retry for link status and receiver capability reads for
+ * cases where the sink may still be asleep.
+ */
+static bool
+intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address,
+ uint8_t *recv, int recv_bytes)
+{
+ int i;
+
+ /*
+ * Sinks are *supposed* to come up within 1ms from an off state,
+ * but we're also supposed to retry 3 times per the spec.
+ */
+ for (i = 0; i < 3; i++) {
+ if (intel_dp_aux_native_read(intel_dp, address, recv,
+ recv_bytes))
+ return true;
+ msleep(1);
+ }
+
+ return false;
+}
+
static int
intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
@@ -1980,30 +2004,6 @@ static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder)
}
/*
- * Native read with retry for link status and receiver capability reads for
- * cases where the sink may still be asleep.
- */
-static bool
-intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address,
- uint8_t *recv, int recv_bytes)
-{
- int i;
-
- /*
- * Sinks are *supposed* to come up within 1ms from an off state,
- * but we're also supposed to retry 3 times per the spec.
- */
- for (i = 0; i < 3; i++) {
- if (intel_dp_aux_native_read(intel_dp, address, recv,
- recv_bytes))
- return true;
- msleep(1);
- }
-
- return false;
-}
-
-/*
* Fetch AUX CH registers 0x202 - 0x207 which contain
* link status information
*/
--
1.7.10.4
next prev parent reply other threads:[~2014-01-30 12:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-30 9:37 [PATCH 0/4] drm/i915/dp: native aux read return value fixes and cleanup Jani Nikula
2014-01-30 9:37 ` [PATCH 1/4] drm/i915/dp: make intel_dp_aux_native_read() return bool Jani Nikula
2014-01-30 10:07 ` Chris Wilson
2014-01-30 12:00 ` [PATCH v2] " Jani Nikula
2014-01-30 9:37 ` [PATCH 2/4] drm/i915/dp: move intel_dp_aux_native_read_retry() near other reads Jani Nikula
2014-01-30 12:00 ` Jani Nikula [this message]
2014-01-30 9:37 ` [PATCH 3/4] drm/i915/dp: clean up cargo culted intel_dp_aux_native_read_retry() usage Jani Nikula
2014-01-30 9:37 ` [PATCH 4/4] drm/i915/dp: fix intel_dp_aux_native_read_retry() return value check Jani Nikula
2014-01-30 9:50 ` [PATCH 0/4] drm/i915/dp: native aux read return value fixes and cleanup Daniel Vetter
2014-01-30 13:37 ` Jani Nikula
2014-01-30 15:05 ` Jani Nikula
2014-01-30 15:12 ` 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=1391083259-2388-1-git-send-email-jani.nikula@intel.com \
--to=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox