Skip to contentSkip to conversation

Rename DP training vswing/pre-emph defines

PATCH In review [email protected] 4 participants 17 messages Aug 5, 2014 – Aug 7, 2014

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

cover Rename DP training vswing/pre-emph defines

From: Sonika Jindal <[email protected]>

Rename the defines to have levels instead of values for vswing and pre-emph levels as the values may differ in other scenarios like low vswing of eDP 1.4 where the values are different.
Updated in all the drivers as well

Sonika Jindal (6):
drm: Renaming DP training vswing/pre-emph defines drm/i915: Renaming DP training vswing/pre-emph defines drm/exynos: Renaming DP training vswing/pre-emph defines drm/radeon: Renaming DP training vswing/pre-emph defines drm/gma500: Renaming DP training vswing/pre-emph defines drm/tegra: Renaming DP training vswing/pre-emph defines

 drivers/gpu/drm/exynos/exynos_dp_core.c |    4 +-
 drivers/gpu/drm/gma500/cdv_intel_dp.c   |   20 ++--
 drivers/gpu/drm/gma500/intel_bios.c     |   16 +--
 drivers/gpu/drm/i915/intel_bios.c       |   16 +--
 drivers/gpu/drm/i915/intel_dp.c         |  194 +++++++++++++++----------------
 drivers/gpu/drm/radeon/atombios_dp.c    |    4 +-
 drivers/gpu/drm/tegra/dpaux.c           |    4 +-
 include/drm/drm_dp_helper.h             |   16 +--
 8 files changed, 137 insertions(+), 137 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/6 drm: Renaming DP training vswing/pre-emph defines

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

---
 include/drm/drm_dp_helper.h |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +8 -8
index a21568b..70f362b 100644
@@ -190,16 +190,16 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
 # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
 # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [PATCH 1/6] drm: Renaming DP training vswing/pre-emph defines

Quoted 5 lines · On Tue, Aug 05, 2014 at 04:38:17PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

You can't split up patches like this since this will break compilation. For larger stuff (and imo this is right above the cutoff) you first need to add the new functions/defines, then convert everyone over. And only when all the drivers are converted can we apply the patch to remove the old functions/defines.
-Daniel

Quoted 40 lines
---
 include/drm/drm_dp_helper.h |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +8 -8
index a21568b..70f362b 100644
@@ -190,16 +190,16 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
 # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
 # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw

Re: [PATCH 1/6] drm: Renaming DP training vswing/pre-emph defines

Quoted 5 lines · Daniel Vetter
Quoted 4 lines · On Tue, Aug 05, 2014 at 04:38:17PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

Quoted 9 lines
Quoted 1 line

You can't split up patches like this since this will break compilation. For larger stuff (and imo this is right above the cutoff) you first need to add the new functions/defines, then convert everyone over. And only when all the drivers are converted can we apply the patch to remove the old functions/defines.
-Daniel

Got your concern. So, I will repost the first patch keeping both the defines and an additional last patch for removing the extra defines.

Quoted 41 lines
Quoted 40 lines
---
  include/drm/drm_dp_helper.h |   16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +8 -9
index a21568b..70f362b 100644
@@ -190,16 +190,16 @@
  # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
  # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
  # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
  # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
  # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
  # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
--

1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Re: [PATCH 1/6] drm: Renaming DP training vswing/pre-emph defines

Quoted 20 lines · Sonika
Quoted 10 lines · Daniel Vetter
Quoted 6 lines · On Tue, Aug 05, 2014 at 04:38:17PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

Quoted 7 lines

You can't split up patches like this since this will break compilation. For larger stuff (and imo this is right above the cutoff) you first need to add the new functions/defines, then convert everyone over. And only when all the drivers are converted can we apply the patch to remove the old functions/defines.
-Daniel

Quoted 2 lines

Got your concern. So, I will repost the first patch keeping both the defines and an additional last patch for removing the extra defines.

Yeah. Btw for the actual replacement I highly recommend to do it with a semantic patch and cocci. There's unfortunately not a hole lot of good documentation around, but we recently started and it helps a lot with regenerating patches (e.g. for newly merged drm drivers) and avoiding mistakes for manual conversions. If we do a cocci patch we put it into the commit message, grep for @@.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw

Re: [PATCH 1/6] drm: Renaming DP training vswing/pre-emph defines

Quoted 24 lines · Daniel Vetter
Quoted 20 lines · Sonika
Quoted 10 lines · Daniel Vetter
Quoted 6 lines · On Tue, Aug 05, 2014 at 04:38:17PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

Quoted 7 lines

You can't split up patches like this since this will break compilation. For larger stuff (and imo this is right above the cutoff) you first need to add the new functions/defines, then convert everyone over. And only when all the drivers are converted can we apply the patch to remove the old functions/defines.
-Daniel

Quoted 2 lines

Got your concern. So, I will repost the first patch keeping both the defines and an additional last patch for removing the extra defines.

Quoted 8 lines

Yeah. Btw for the actual replacement I highly recommend to do it with a semantic patch and cocci. There's unfortunately not a hole lot of good documentation around, but we recently started and it helps a lot with regenerating patches (e.g. for newly merged drm drivers) and avoiding mistakes for manual conversions. If we do a cocci patch we put it into the commit message, grep for @@.
-Daniel

I need to find out about cocci. Can we go ahead with this patch series only? -Sonika

#6 lore raw

PATCH 1/1 drm: Renaming DP training vswing/pre-emph defines

In reply to Daniel Vetter

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

v2: Keeping old and new defines (Danvet)

---
 include/drm/drm_dp_helper.h |   26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +18 -8
index a21568b..df1e262 100644
@@ -190,16 +190,26 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_400        (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_600        (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_800        (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_1200       (3 << 0)
+
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_0           (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_3_5         (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_6           (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_9_5         (3 << 3)
+
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
 # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
 # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 1/1 drm: Removing the redundant vswing/pre-emph defines

From: Sonika Jindal <[email protected]>

Removing the defines in the end after changing in all the drivers to avoid compilation issues with individual patches in the series.

---
 include/drm/drm_dp_helper.h |   10 ----------
 1 file changed, 10 deletions(-)
include/drm/drm_dp_helper.h +0 -10
index df1e262..70f362b 100644
@@ -190,22 +190,12 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400        (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600        (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800        (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200       (3 << 0)
-
 # define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
 # define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
 # define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
 # define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0           (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5         (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6           (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5         (3 << 3)
-
 # define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
 # define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
 # define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
Signature · 1 line
1.7.10.4
#8 lore raw

PATCH 1/1 drm: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

Rename the defines to have levels instead of values for vswing and pre-emph levels as the values may differ in other scenarios like low vswing of eDP 1.4 where the values are different.

v2: Keeping old and new defines (Danvet), adding description in the commit message

---
 include/drm/drm_dp_helper.h |   26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +18 -8
index a21568b..df1e262 100644
@@ -190,16 +190,26 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_400        (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_600        (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_800        (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_1200       (3 << 0)
+
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_0           (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_3_5         (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_6           (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_9_5         (3 << 3)
+
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
 # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
 # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
Signature · 1 line
1.7.10.4
#9 lore raw

Re: [PATCH 1/6] drm: Renaming DP training vswing/pre-emph defines

In reply to [email protected]
Quoted 4 lines · Sonika Jindal

From: Sonika Jindal <[email protected]>

Renaming defines to have levels instead of nominal values.

(+cc Daniel Vetter)

Hi Sonika Jindal,

Thank you for sending the patch. However, please add the reason to this commit message, as you said at '[PATCH 0/6] Rename DP training vswing/pre-emph defines'.

Best regards.
Jingoo Han

Quoted 37 lines
---
 include/drm/drm_dp_helper.h |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/drm/drm_dp_helper.h +8 -9
index a21568b..70f362b 100644
@@ -190,16 +190,16 @@
 # define DP_TRAIN_VOLTAGE_SWING_MASK	    0x3
 # define DP_TRAIN_VOLTAGE_SWING_SHIFT	    0
 # define DP_TRAIN_MAX_SWING_REACHED	    (1 << 2)
-# define DP_TRAIN_VOLTAGE_SWING_400	    (0 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_600	    (1 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_800	    (2 << 0)
-# define DP_TRAIN_VOLTAGE_SWING_1200	    (3 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_0     (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_1     (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_2     (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_LEVEL_3     (3 << 0)
 
 # define DP_TRAIN_PRE_EMPHASIS_MASK	    (3 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_0	    (0 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_3_5	    (1 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_6	    (2 << 3)
-# define DP_TRAIN_PRE_EMPHASIS_9_5	    (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_0  (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_1  (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_2  (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_LEVEL_3  (3 << 3)
 
 # define DP_TRAIN_PRE_EMPHASIS_SHIFT	    3
 # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
--

1.7.10.4

#10 lore raw

PATCH 2/6 drm/i915: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

Changing the DP training vswing/pre-emph defines in i915.

---
 drivers/gpu/drm/i915/intel_bios.c |   16 +--
 drivers/gpu/drm/i915/intel_dp.c   |  194 ++++++++++++++++++-------------------
 2 files changed, 105 insertions(+), 105 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +8 -8
index 031c565..ef11274 100644
@@ -627,16 +627,16 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 
 	switch (edp_link_params->preemphasis) {
 	case EDP_PREEMPHASIS_NONE:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_0;
 		break;
 	case EDP_PREEMPHASIS_3_5dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_1;
 		break;
 	case EDP_PREEMPHASIS_6dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_2;
 		break;
 	case EDP_PREEMPHASIS_9_5dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_3;
 		break;
 	default:
 		DRM_DEBUG_KMS("VBT has unknown eDP pre-emphasis value %u\n",
@@ -646,16 +646,16 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 
 	switch (edp_link_params->vswing) {
 	case EDP_VSWING_0_4V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_400;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0
 		break;
 	case EDP_VSWING_0_6V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_600;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
 		break;
 	case EDP_VSWING_0_8V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_800;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
 		break;
 	case EDP_VSWING_1_2V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_1200;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
 		break;
 	default:
 		DRM_DEBUG_KMS("VBT has unknown eDP voltage swing value %u\n",
drivers/gpu/drm/i915/intel_dp.c +97 -97

389 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#11 lore raw

PATCH 1/1 drm/i915: Renaming DP training vswing/pre-emph defines

From: Sonika Jindal <[email protected]>

Changing the DP training vswing/pre-emph defines in i915.

v2: Corrected an error

---
 drivers/gpu/drm/i915/intel_bios.c |   16 +--
 drivers/gpu/drm/i915/intel_dp.c   |  194 ++++++++++++++++++-------------------
 2 files changed, 105 insertions(+), 105 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +8 -8
index 031c565..822e869 100644
@@ -627,16 +627,16 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 
 	switch (edp_link_params->preemphasis) {
 	case EDP_PREEMPHASIS_NONE:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_0;
 		break;
 	case EDP_PREEMPHASIS_3_5dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_1;
 		break;
 	case EDP_PREEMPHASIS_6dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_2;
 		break;
 	case EDP_PREEMPHASIS_9_5dB:
-		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
+		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_3;
 		break;
 	default:
 		DRM_DEBUG_KMS("VBT has unknown eDP pre-emphasis value %u\n",
@@ -646,16 +646,16 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 
 	switch (edp_link_params->vswing) {
 	case EDP_VSWING_0_4V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_400;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
 		break;
 	case EDP_VSWING_0_6V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_600;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
 		break;
 	case EDP_VSWING_0_8V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_800;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
 		break;
 	case EDP_VSWING_1_2V:
-		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_1200;
+		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
 		break;
 	default:
 		DRM_DEBUG_KMS("VBT has unknown eDP voltage swing value %u\n",
drivers/gpu/drm/i915/intel_dp.c +97 -97

389 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#12 lore raw

PATCH 3/6 drm/exynos: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/exynos/exynos_dp_core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +2 -2
index 31c3de9..e520943 100644
@@ -331,8 +331,8 @@ static int exynos_dp_link_start(struct exynos_dp_device *dp)
 		return retval;
 
 	for (lane = 0; lane < lane_count; lane++)
-		buf[lane] = DP_TRAIN_PRE_EMPHASIS_0 |
-			    DP_TRAIN_VOLTAGE_SWING_400;
+		buf[lane] = DP_TRAIN_PRE_EMPHASIS_LEVEL_0 |
+			    DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
 
 	retval = exynos_dp_write_bytes_to_dpcd(dp, DP_TRAINING_LANE0_SET,
 			lane_count, buf);
Signature · 1 line
1.7.10.4
#13 lore raw

PATCH 4/6 drm/radeon: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/radeon/atombios_dp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +2 -2
index b1e11f8..ef32b16 100644
@@ -232,8 +232,8 @@ void radeon_dp_aux_init(struct radeon_connector *radeon_connector)
 
 /***** general DP utility functions *****/
 
-#define DP_VOLTAGE_MAX         DP_TRAIN_VOLTAGE_SWING_1200
-#define DP_PRE_EMPHASIS_MAX    DP_TRAIN_PRE_EMPHASIS_9_5
+#define DP_VOLTAGE_MAX         DP_TRAIN_VOLTAGE_SWING_LEVEL_3
+#define DP_PRE_EMPHASIS_MAX    DP_TRAIN_PRE_EMPHASIS_LEVEL_3
 
 static void dp_get_adjust_train(u8 link_status[DP_LINK_STATUS_SIZE],
 				int lane_count,
Signature · 1 line
1.7.10.4
#14 lore raw

PATCH 5/6 drm/gma500: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/gma500/cdv_intel_dp.c |   20 ++++++++++----------
 drivers/gpu/drm/gma500/intel_bios.c   |   16 ++++++++--------
 2 files changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_dp.c +10 -10
index a4cc0e6..a9ef65d 100644
@@ -1089,21 +1089,21 @@ static char	*link_train_names[] = {
 };
 #endif
 
-#define CDV_DP_VOLTAGE_MAX	    DP_TRAIN_VOLTAGE_SWING_1200
+#define CDV_DP_VOLTAGE_MAX	    DP_TRAIN_VOLTAGE_SWING_LEVEL_3
 /*
 static uint8_t
 cdv_intel_dp_pre_emphasis_max(uint8_t voltage_swing)
 {
 	switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) {
-	case DP_TRAIN_VOLTAGE_SWING_400:
-		return DP_TRAIN_PRE_EMPHASIS_6;
-	case DP_TRAIN_VOLTAGE_SWING_600:
-		return DP_TRAIN_PRE_EMPHASIS_6;
-	case DP_TRAIN_VOLTAGE_SWING_800:
-		return DP_TRAIN_PRE_EMPHASIS_3_5;
-	case DP_TRAIN_VOLTAGE_SWING_1200:
+	case DP_TRAIN_VOLTAGE_SWING_LEVEL_0:
+		return DP_TRAIN_PRE_EMPHASIS_LEVEL_2;
+	case DP_TRAIN_VOLTAGE_SWING_LEVEL_1:
+		return DP_TRAIN_PRE_EMPHASIS_LEVEL_2;
+	case DP_TRAIN_VOLTAGE_SWING_LEVEL_2:
+		return DP_TRAIN_PRE_EMPHASIS_LEVEL_1;
+	case DP_TRAIN_VOLTAGE_SWING_LEVEL_3:
 	default:
-		return DP_TRAIN_PRE_EMPHASIS_0;
+		return DP_TRAIN_PRE_EMPHASIS_LEVEL_0;
 	}
 }
 */
@@ -1276,7 +1276,7 @@ cdv_intel_dp_set_vswing_premph(struct gma_encoder *encoder, uint8_t signal_level
 		cdv_sb_write(dev, ddi_reg->VSwing2, dp_vswing_premph_table[index]);
 
 	/* ;gfx_dpio_set_reg(0x814c, 0x40802040) */
-	if ((vswing + premph) == DP_TRAIN_VOLTAGE_SWING_1200)
+	if ((vswing + premph) == DP_TRAIN_VOLTAGE_SWING_LEVEL_3)
 		cdv_sb_write(dev, ddi_reg->VSwing3, 0x70802040);
 	else
 		cdv_sb_write(dev, ddi_reg->VSwing3, 0x40802040);
drivers/gpu/drm/gma500/intel_bios.c +8 -8
index d349734..9573283 100644
@@ -116,30 +116,30 @@ parse_edp(struct drm_psb_private *dev_priv, struct bdb_header *bdb)
 
 	switch (edp_link_params->preemphasis) {
 	case 0:
-		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
+		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_0;
 		break;
 	case 1:
-		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
+		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_1;
 		break;
 	case 2:
-		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
+		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_2;
 		break;
 	case 3:
-		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
+		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_LEVEL_3;
 		break;
 	}
 	switch (edp_link_params->vswing) {
 	case 0:
-		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_400;
+		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
 		break;
 	case 1:
-		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_600;
+		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
 		break;
 	case 2:
-		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_800;
+		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
 		break;
 	case 3:
-		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_1200;
+		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
 		break;
 	}
 	DRM_DEBUG_KMS("VBT reports EDP: VSwing  %d, Preemph %d\n",
Signature · 1 line
1.7.10.4
#15 lore raw

PATCH 6/6 drm/tegra: Renaming DP training vswing/pre-emph defines

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/tegra/dpaux.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tegra/dpaux.c +2 -2
index 3f132e3..34f3c1d 100644
@@ -532,9 +532,9 @@ int tegra_dpaux_train(struct tegra_dpaux *dpaux, struct drm_dp_link *link,
 
 	for (i = 0; i < link->num_lanes; i++)
 		values[i] = DP_TRAIN_MAX_PRE_EMPHASIS_REACHED |
-			    DP_TRAIN_PRE_EMPHASIS_0 |
+			    DP_TRAIN_PRE_EMPHASIS_LEVEL_0 |
 			    DP_TRAIN_MAX_SWING_REACHED |
-			    DP_TRAIN_VOLTAGE_SWING_400;
+			    DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
 
 	err = drm_dp_dpcd_write(&dpaux->aux, DP_TRAINING_LANE0_SET, values,
 				link->num_lanes);
Signature · 1 line
1.7.10.4
#16 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, Aug 05, 2014 at 04:38:16PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

Rename the defines to have levels instead of values for vswing and pre-emph levels as the values may differ in other scenarios like low vswing of eDP 1.4 where the values are different.
Updated in all the drivers as well

Hi Sonika,

Oops, another mess in this series :) If there's a need to rework the series and add/remove patches, the best way to send a v2 is to actually resend the whole series, otherwise someone will get it wrong and won't apply the right patches.

So, could you resend the whole series again with the patches generated by Daniel's review comment and with the explanation copy/pasted in all the driver patches (as Jingoo Han asked). It's fair enough to track why the rename was needed in driver-specific patches instead of relying on the cover letter.

Thanks,

Signature · 1 line
Damien