All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Simplify intel_dp_voltage_max()
@ 2015-10-05 14:44 Ander Conselvan de Oliveira
  2015-10-05 14:44 ` [PATCH 2/2] drm/i915: Simplify intel_dp_pre_emphasis_max() Ander Conselvan de Oliveira
  0 siblings, 1 reply; 3+ messages in thread
From: Ander Conselvan de Oliveira @ 2015-10-05 14:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ander Conselvan de Oliveira

The function intel_dp_voltage_max() returns either voltage swing level 2
or level 3 for a few special cases. Simplify the if ladder by grouping
the few special cases that cause it return level 3. Make it clearer that
level 2 is the default by putting it out of the else condition.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b785f1f..3fa8a55 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3066,20 +3066,17 @@ intel_dp_voltage_max(struct intel_dp *intel_dp)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	enum port port = dp_to_dig_port(intel_dp)->port;
 
-	if (IS_BROXTON(dev))
+	if (IS_BROXTON(dev) || IS_VALLEYVIEW(dev))
 		return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
-	else if (INTEL_INFO(dev)->gen >= 9) {
-		if (dev_priv->edp_low_vswing && port == PORT_A)
-			return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
-		return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
-	} else if (IS_VALLEYVIEW(dev))
+
+	if (INTEL_INFO(dev)->gen >= 9 &&
+	    dev_priv->edp_low_vswing && port == PORT_A)
 		return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
-	else if (IS_GEN7(dev) && port == PORT_A)
-		return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
-	else if (HAS_PCH_CPT(dev) && port != PORT_A)
+
+	if (HAS_PCH_CPT(dev) && port != PORT_A)
 		return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
-	else
-		return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
+
+	return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
 }
 
 uint8_t
-- 
2.4.3

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

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

end of thread, other threads:[~2015-10-08 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 14:44 [PATCH 1/2] drm/i915: Simplify intel_dp_voltage_max() Ander Conselvan de Oliveira
2015-10-05 14:44 ` [PATCH 2/2] drm/i915: Simplify intel_dp_pre_emphasis_max() Ander Conselvan de Oliveira
2015-10-08 16:20   ` Ander Conselvan De Oliveira

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.