From: Imre Deak <imre.deak@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915: Call intel_ddi_init_dp_buf_reg() earlier
Date: Thu, 30 Sep 2021 18:51:37 +0300 [thread overview]
Message-ID: <20210930155137.GD2418125@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20210930134310.31669-2-ville.syrjala@linux.intel.com>
On Thu, Sep 30, 2021 at 04:43:08PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> I want intel_dp->DP to be fully populated by the time the
> initial vswing programming happens. To that end move the
> intel_ddi_init_dp_buf_reg() call to an earlier spot.
>
> Additionally we don't want intel_ddi_init_dp_buf_reg() to
> set DDI_BUF_CTL_ENABLE since the port should only get enabled
> at the start of link training (see intel_ddi_prepare_link_retrain()).
> So any earlier write to the register should not set the enable bit.
>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_ddi.c | 44 +++++++++++-------------
> 1 file changed, 21 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 51d07e9af9f3..65e59f16879d 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -282,9 +282,10 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> enum phy phy = intel_port_to_phy(i915, encoder->port);
>
> + /* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
> intel_dp->DP = dig_port->saved_port_bits |
> - DDI_BUF_CTL_ENABLE | DDI_BUF_TRANS_SELECT(0);
> - intel_dp->DP |= DDI_PORT_WIDTH(crtc_state->lane_count);
> + DDI_PORT_WIDTH(crtc_state->lane_count) |
> + DDI_BUF_TRANS_SELECT(0);
>
> if (IS_ALDERLAKE_P(i915) && intel_phy_is_tc(i915, phy)) {
> intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> @@ -2360,6 +2361,12 @@ static void dg2_ddi_pre_enable_dp(struct intel_atomic_state *state,
> intel_dp_set_link_params(intel_dp, crtc_state->port_clock,
> crtc_state->lane_count);
>
> + /*
> + * We only configure what the register value will be here. Actual
> + * enabling happens during link training farther down.
> + */
> + intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> +
> /*
> * 1. Enable Power Wells
> *
> @@ -2416,16 +2423,6 @@ static void dg2_ddi_pre_enable_dp(struct intel_atomic_state *state,
> /* 5.e Configure voltage swing and related IO settings */
> intel_snps_phy_ddi_vswing_sequence(encoder, crtc_state, level);
>
> - /*
> - * 5.f Configure and enable DDI_BUF_CTL
> - * 5.g Wait for DDI_BUF_CTL DDI Idle Status = 0b (Not Idle), timeout
> - * after 1200 us.
> - *
> - * We only configure what the register value will be here. Actual
> - * enabling happens during link training farther down.
> - */
> - intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> -
> if (!is_mst)
> intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
>
> @@ -2473,6 +2470,12 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,
> crtc_state->port_clock,
> crtc_state->lane_count);
>
> + /*
> + * We only configure what the register value will be here. Actual
> + * enabling happens during link training farther down.
> + */
> + intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> +
> /*
> * 1. Enable Power Wells
> *
> @@ -2554,16 +2557,6 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,
> */
> intel_ddi_mso_configure(crtc_state);
>
> - /*
> - * 7.g Configure and enable DDI_BUF_CTL
> - * 7.h Wait for DDI_BUF_CTL DDI Idle Status = 0b (Not Idle), timeout
> - * after 500 us.
> - *
> - * We only configure what the register value will be here. Actual
> - * enabling happens during link training farther down.
> - */
> - intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> -
> if (!is_mst)
> intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
>
> @@ -2620,6 +2613,12 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,
> crtc_state->port_clock,
> crtc_state->lane_count);
>
> + /*
> + * We only configure what the register value will be here. Actual
> + * enabling happens during link training farther down.
> + */
> + intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> +
> intel_pps_on(intel_dp);
>
> intel_ddi_enable_clock(encoder, crtc_state);
> @@ -2641,7 +2640,6 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,
>
> intel_ddi_power_up_lanes(encoder, crtc_state);
>
> - intel_ddi_init_dp_buf_reg(encoder, crtc_state);
> if (!is_mst)
> intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
> intel_dp_configure_protocol_converter(intel_dp, crtc_state);
> --
> 2.32.0
>
next prev parent reply other threads:[~2021-09-30 15:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 13:43 [Intel-gfx] [PATCH 1/4] drm/i915: Clear leftover DP vswing/preemphasis values before modeset Ville Syrjala
2021-09-30 13:43 ` [Intel-gfx] [PATCH 2/4] drm/i915: Call intel_ddi_init_dp_buf_reg() earlier Ville Syrjala
2021-09-30 15:51 ` Imre Deak [this message]
2021-09-30 13:43 ` [Intel-gfx] [PATCH 3/4] drm/i915: Remove DP_PORT_EN stuff from link training code Ville Syrjala
2021-09-30 16:09 ` Imre Deak
2021-09-30 16:16 ` Ville Syrjälä
2021-09-30 16:19 ` Imre Deak
2021-09-30 16:21 ` Imre Deak
2021-09-30 13:43 ` [Intel-gfx] [PATCH 4/4] drm/i915: Nuke local copies/pointers of intel_dp->DP Ville Syrjala
2021-09-30 16:15 ` Imre Deak
2021-09-30 15:25 ` [Intel-gfx] [PATCH 1/4] drm/i915: Clear leftover DP vswing/preemphasis values before modeset Imre Deak
2021-09-30 16:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
2021-09-30 19:49 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=20210930155137.GD2418125@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox