[PATCH 5/8] drm/i915: Don't call intel_dp_set_signal_levels() on link train reset

Ander Conselvan de Oliveira
2015-09-08T12:28:16Z

Instead of calling intel_dp_set_signal_levels(), which writes the
desired signal levels mask to a variable, just call the new function
intel_dp_update_signal_levels(). The effect should be the same, except
for an extra register write, but this creates a better split between the
generic link training logic and the i915 specific part.
---
drivers/gpu/drm/i915/intel_dp.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a51ae48..d5c1b0a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3638,16 +3638,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp,
return ret == len;
}

-static bool
-intel_dp_reset_link_train(struct intel_dp *intel_dp,
- uint8_t dp_train_pat)
-{
- if (!intel_dp->train_set_valid)
- memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
- intel_dp_set_signal_levels(intel_dp, &intel_dp->DP);
- return intel_dp_set_link_train(intel_dp, dp_train_pat);
-}
-
static void
intel_dp_update_signal_levels(struct intel_dp *intel_dp)
{
@@ -3662,6 +3652,16 @@ intel_dp_update_signal_levels(struct intel_dp *intel_dp)
}

static bool
+intel_dp_reset_link_train(struct intel_dp *intel_dp,
+ uint8_t dp_train_pat)
+{
+ if (!intel_dp->train_set_valid)
+ memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
+ intel_dp_update_signal_levels(intel_dp);
+ return intel_dp_set_link_train(intel_dp, dp_train_pat);
+}
+
+static bool
intel_dp_update_link_train(struct intel_dp *intel_dp)
{
int ret;
--
2.4.3