All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/dp: Generalize intel_dp_link_params function to accept arguments to be validated
@ 2017-06-02  0:51 Manasi Navare
  2017-06-02  0:51 ` [PATCH 2/2] drm/i915/dp: Validate the compliance test link parameters Manasi Navare
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Manasi Navare @ 2017-06-02  0:51 UTC (permalink / raw)
  To: intel-gfx

This function now takes the link rate and lane ocunt to be validated
as an argument so that this can be used for validating even the
compliance test link parameters.

Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 58dca87..832786d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -322,19 +322,20 @@ static int intel_dp_common_len_rate_limit(struct intel_dp *intel_dp,
 	return 0;
 }
 
-static bool intel_dp_link_params_valid(struct intel_dp *intel_dp)
+static bool intel_dp_link_params_valid(struct intel_dp *intel_dp, int link_rate,
+				       uint8_t lane_count)
 {
 	/*
 	 * FIXME: we need to synchronize the current link parameters with
 	 * hardware readout. Currently fast link training doesn't work on
 	 * boot-up.
 	 */
-	if (intel_dp->link_rate == 0 ||
-	    intel_dp->link_rate > intel_dp->max_link_rate)
+	if (link_rate == 0 ||
+	    link_rate > intel_dp->max_link_rate)
 		return false;
 
-	if (intel_dp->lane_count == 0 ||
-	    intel_dp->lane_count > intel_dp_max_lane_count(intel_dp))
+	if (lane_count == 0 ||
+	    lane_count > intel_dp_max_lane_count(intel_dp))
 		return false;
 
 	return true;
@@ -4260,7 +4261,8 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 	 * Validate the cached values of intel_dp->link_rate and
 	 * intel_dp->lane_count before attempting to retrain.
 	 */
-	if (!intel_dp_link_params_valid(intel_dp))
+	if (!intel_dp_link_params_valid(intel_dp, intel_dp->link_rate,
+					intel_dp->lane_count))
 		return;
 
 	/* Retrain if Channel EQ or CR not ok */
-- 
2.1.4

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-08 18:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02  0:51 [PATCH 1/2] drm/i915/dp: Generalize intel_dp_link_params function to accept arguments to be validated Manasi Navare
2017-06-02  0:51 ` [PATCH 2/2] drm/i915/dp: Validate the compliance test link parameters Manasi Navare
2017-06-02  8:27   ` Jani Nikula
2017-06-02  8:55     ` Jani Nikula
2017-06-08 18:36       ` Manasi Navare
2017-06-05 18:27     ` Manasi Navare
2017-06-02 10:34   ` Ville Syrjälä
2017-06-05 18:39     ` Manasi Navare
2017-06-02  1:04 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/dp: Generalize intel_dp_link_params function to accept arguments to be validated Patchwork
2017-06-02  8:22 ` [PATCH 1/2] " Jani Nikula

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.