From: Deepak <deepak.s@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/15] drm/i915: Always program unique transition scale for CHV
Date: Mon, 17 Aug 2015 08:01:26 +0530 [thread overview]
Message-ID: <55D1477E.6020204@linux.intel.com> (raw)
In-Reply-To: <1436388361-11130-3-git-send-email-ville.syrjala@linux.intel.com>
On 07/09/2015 02:15 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The docs give you the impression that the unique transition scale
> value shouldn't matter when unique transition scale is enabled. But
> as Imre found on BXT (and I verfied also on BSW) the value does
> matter. So from now on just program the same value 0x9a always.
>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 53 +++++++++++++++++++--------------------
> drivers/gpu/drm/i915/intel_hdmi.c | 30 +++++++++++-----------
> 2 files changed, 42 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index f424833..32d7e43 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3142,6 +3142,12 @@ static uint32_t vlv_signal_levels(struct intel_dp *intel_dp)
> return 0;
> }
>
> +static bool chv_need_uniq_trans_scale(uint8_t train_set)
> +{
> + return (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) == DP_TRAIN_PRE_EMPH_LEVEL_0 &&
> + (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) == DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
> +}
> +
> static uint32_t chv_signal_levels(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> @@ -3260,41 +3266,34 @@ static uint32_t chv_signal_levels(struct intel_dp *intel_dp)
> /* Program swing margin */
> for (i = 0; i < 4; i++) {
> val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i));
> +
> val &= ~DPIO_SWING_MARGIN000_MASK;
> val |= margin_reg_value << DPIO_SWING_MARGIN000_SHIFT;
> +
> + /*
> + * Supposedly this value shouldn't matter when unique transition
> + * scale is disabled, but in fact it does matter. Let's just
> + * always program the same value and hope it's OK.
> + */
> + val &= ~(0xff << DPIO_UNIQ_TRANS_SCALE_SHIFT);
> + val |= 0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT;
> +
> vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val);
> }
>
> - /* Disable unique transition scale */
> + /*
> + * The document said it needs to set bit 27 for ch0 and bit 26
> + * for ch1. Might be a typo in the doc.
> + * For now, for this unique transition scale selection, set bit
> + * 27 for ch0 and ch1.
> + */
> for (i = 0; i < 4; i++) {
> val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i));
> - val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN;
> - vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
> - }
> -
> - if (((train_set & DP_TRAIN_PRE_EMPHASIS_MASK)
> - == DP_TRAIN_PRE_EMPH_LEVEL_0) &&
> - ((train_set & DP_TRAIN_VOLTAGE_SWING_MASK)
> - == DP_TRAIN_VOLTAGE_SWING_LEVEL_3)) {
> -
> - /*
> - * The document said it needs to set bit 27 for ch0 and bit 26
> - * for ch1. Might be a typo in the doc.
> - * For now, for this unique transition scale selection, set bit
> - * 27 for ch0 and ch1.
> - */
> - for (i = 0; i < 4; i++) {
> - val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i));
> + if (chv_need_uniq_trans_scale(train_set))
> val |= DPIO_TX_UNIQ_TRANS_SCALE_EN;
> - vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
> - }
> -
> - for (i = 0; i < 4; i++) {
> - val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i));
> - val &= ~(0xff << DPIO_UNIQ_TRANS_SCALE_SHIFT);
> - val |= (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT);
> - vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val);
> - }
> + else
> + val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN;
> + vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
> }
>
> /* Start swing calculation */
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index ba845f7..9f79afb 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1846,31 +1846,33 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)
>
> for (i = 0; i < 4; i++) {
> val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i));
> +
> val &= ~DPIO_SWING_MARGIN000_MASK;
> val |= 102 << DPIO_SWING_MARGIN000_SHIFT;
> +
> + /*
> + * Supposedly this value shouldn't matter when unique transition
> + * scale is disabled, but in fact it does matter. Let's just
> + * always program the same value and hope it's OK.
> + */
> + val &= ~(0xff << DPIO_UNIQ_TRANS_SCALE_SHIFT);
> + val |= 0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT;
> +
> vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val);
> }
>
> - /* Disable unique transition scale */
> + /*
> + * The document said it needs to set bit 27 for ch0 and bit 26
> + * for ch1. Might be a typo in the doc.
> + * For now, for this unique transition scale selection, set bit
> + * 27 for ch0 and ch1.
> + */
> for (i = 0; i < 4; i++) {
> val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i));
> val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN;
> vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
> }
>
> - /* Additional steps for 1200mV-0dB */
> -#if 0
> - val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch));
> - if (ch)
> - val |= DPIO_TX_UNIQ_TRANS_SCALE_CH1;
> - else
> - val |= DPIO_TX_UNIQ_TRANS_SCALE_CH0;
> - vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val);
> -
> - vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch),
> - vlv_dpio_read(dev_priv, pipe, VLV_TX_DW2(ch)) |
> - (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT));
> -#endif
> /* Start swing calculation */
> val = vlv_dpio_read(dev_priv, pipe, VLV_PCS01_DW10(ch));
> val |= DPIO_PCS_SWING_CALC_TX0_TX2 | DPIO_PCS_SWING_CALC_TX1_TX3;
Looks fine to me
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-17 2:33 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 20:45 [PATCH 00/15] drm/i915: CHV DPIO power gating, take two ville.syrjala
2015-07-08 20:45 ` [PATCH 01/15] drm/i915: Always program m2 fractional value on CHV ville.syrjala
2015-08-17 2:19 ` Deepak
2015-08-17 11:45 ` Ville Syrjälä
2015-08-26 8:11 ` Deepak
2015-07-08 20:45 ` [PATCH 02/15] drm/i915: Always program unique transition scale for CHV ville.syrjala
2015-08-17 2:31 ` Deepak [this message]
2015-07-08 20:45 ` [PATCH 03/15] drm/i915: Add encoder->post_pll_disable() hooks and move CHV clock buffer disables there ville.syrjala
2015-08-17 4:16 ` Deepak
2015-08-17 11:53 ` Ville Syrjälä
2015-08-26 8:14 ` Deepak
2015-07-08 20:45 ` [PATCH 04/15] drm/i915: Move DPIO port init earlier ville.syrjala
2015-08-17 4:18 ` Deepak
2015-07-08 20:45 ` [PATCH 05/15] drm/i915: Add locking around chv_phy_control_init() ville.syrjala
2015-08-17 4:23 ` Deepak
2015-07-08 20:45 ` [PATCH 06/15] drm/i915: Move VLV/CHV prepare_pll later ville.syrjala
2015-08-17 4:36 ` Deepak
2015-08-17 4:39 ` Deepak
2015-07-08 20:45 ` [PATCH 07/15] drm/i915: Add vlv_dport_to_phy() ville.syrjala
2015-08-17 4:56 ` Deepak
2015-08-26 8:24 ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 08/15] drm/i915: Implement PHY lane power gating for CHV ville.syrjala
2015-08-19 1:48 ` Deepak
2015-08-26 8:27 ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 09/15] drm/i915: Trick CL2 into life on CHV when using pipe B with port B ville.syrjala
2015-08-19 2:17 ` Deepak
2015-08-19 11:29 ` Ville Syrjälä
2015-08-26 12:36 ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 10/15] drm/i915: Force common lane on for the PPS kick on CHV ville.syrjala
2015-07-10 7:56 ` [PATCH v2 " ville.syrjala
2015-08-19 2:21 ` [PATCH " Deepak
2015-08-19 11:32 ` Ville Syrjälä
2015-07-08 20:45 ` [PATCH 11/15] drm/i915: Enable DPIO SUS clock gating " ville.syrjala
2015-08-19 13:09 ` Deepak
2015-07-08 20:45 ` [PATCH 12/15] drm/i915: Force CL2 off in CHV x1 PHY ville.syrjala
2015-08-19 13:22 ` Deepak
2015-08-19 13:39 ` Ville Syrjälä
2015-08-26 12:38 ` Daniel Vetter
2015-07-08 20:45 ` [PATCH 13/15] drm/i915: Clean up CHV lane soft reset programming ville.syrjala
2015-07-09 16:27 ` Daniel Vetter
2015-07-09 17:14 ` [PATCH v2 " ville.syrjala
2015-08-27 4:25 ` [PATCH " Deepak
2015-07-08 20:46 ` [PATCH 14/15] drm/i915: Add some CHV DPIO lane power state asserts ville.syrjala
2015-08-27 4:36 ` Deepak
2015-08-27 11:02 ` Ville Syrjälä
2015-08-31 10:47 ` Deepak
2015-07-08 20:46 ` [PATCH 15/15] drm/i915: Add CHV PHY LDO power sanity checks ville.syrjala
2015-08-27 4:39 ` Deepak
2015-09-01 9:45 ` Daniel Vetter
2015-07-09 13:24 ` [PATCH 00/15] drm/i915: CHV DPIO power gating, take two Deepak
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=55D1477E.6020204@linux.intel.com \
--to=deepak.s@linux.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 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.