Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Manna, Animesh" <animesh.manna@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 13/23] drm/i915/dp: Master/Slave enable/disable sequence for bigjoiner
Date: Tue, 17 Nov 2020 09:17:31 +0000	[thread overview]
Message-ID: <787005163f85455790370b0dff9cb506@intel.com> (raw)
In-Reply-To: <20201113220358.24794-14-ville.syrjala@linux.intel.com>



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Saturday, November 14, 2020 3:34 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 13/23] drm/i915/dp: Master/Slave enable/disable
> sequence for bigjoiner
> 
> From: Manasi Navare <manasi.d.navare@intel.com>
> 
> Enabling is done in a special sequence and so should plane updates be. Ideally
> the end user never notices the second pipe is used.
> 
> This way ideally everything will be tear free, and updates are really atomic as
> userspace expects it.
> 
> This uses generic modeset_enables() calls like trans port sync but still has special
> handling for disable since for slave we should not disable things like encoder, plls
> that are not enabled for  slave.
> 
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> [vsyrjala: Appease checkpatch]
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c     |  25 +++-
>  drivers/gpu/drm/i915/display/intel_display.c | 126 +++++++++++++++----
>  2 files changed, 122 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 439b92710fe6..9c4ad0392025 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -28,6 +28,7 @@
>  #include <drm/drm_scdc_helper.h>
> 
>  #include "i915_drv.h"
> +#include "i915_trace.h"
>  #include "intel_audio.h"
>  #include "intel_combo_phy.h"
>  #include "intel_connector.h"
> @@ -3664,7 +3665,8 @@ static void tgl_ddi_pre_enable_dp(struct
> intel_atomic_state *state,
> 
>  	/* 7.l Configure and enable FEC if needed */
>  	intel_ddi_enable_fec(encoder, crtc_state);
> -	intel_dsc_enable(encoder, crtc_state);
> +	if (!crtc_state->bigjoiner)
> +		intel_dsc_enable(encoder, crtc_state);
>  }
> 
>  static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state, @@ -
> 3736,7 +3738,8 @@ static void hsw_ddi_pre_enable_dp(struct
> intel_atomic_state *state,
>  	if (!is_mst)
>  		intel_ddi_enable_pipe_clock(encoder, crtc_state);
> 
> -	intel_dsc_enable(encoder, crtc_state);
> +	if (!crtc_state->bigjoiner)
> +		intel_dsc_enable(encoder, crtc_state);
>  }
> 
>  static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state, @@ -
> 3987,6 +3990,21 @@ static void intel_ddi_post_disable(struct
> intel_atomic_state *state,
>  			ilk_pfit_disable(old_crtc_state);
>  	}
> 
> +	if (old_crtc_state->bigjoiner_linked_crtc) {
> +		struct intel_atomic_state *state =
> +			to_intel_atomic_state(old_crtc_state->uapi.state);
> +		struct intel_crtc *slave =
> +			old_crtc_state->bigjoiner_linked_crtc;
> +		const struct intel_crtc_state *old_slave_crtc_state =
> +			intel_atomic_get_old_crtc_state(state, slave);
> +
> +		intel_crtc_vblank_off(old_slave_crtc_state);
> +		trace_intel_pipe_disable(slave);
> +
> +		intel_dsc_disable(old_slave_crtc_state);
> +		skl_scaler_disable(old_slave_crtc_state);
> +	}
> +
>  	/*
>  	 * When called from DP MST code:
>  	 * - old_conn_state will be NULL
> @@ -4205,7 +4223,8 @@ static void intel_enable_ddi(struct intel_atomic_state
> *state,  {
>  	drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
> 
> -	intel_ddi_enable_transcoder_func(encoder, crtc_state);
> +	if (!crtc_state->bigjoiner_slave)
> +		intel_ddi_enable_transcoder_func(encoder, crtc_state);
> 
>  	intel_enable_pipe(crtc_state);
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index aea2ff3ef8c4..60669bef659f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7138,6 +7138,45 @@ static void hsw_set_frame_start_delay(const struct
> intel_crtc_state *crtc_state)
>  	intel_de_write(dev_priv, reg, val);
>  }
> 
> +static void icl_ddi_bigjoiner_pre_enable(struct intel_atomic_state *state,
> +					 const struct intel_crtc_state
> *crtc_state) {
> +	struct intel_crtc *master = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_crtc_state *master_crtc_state;
> +	struct drm_connector_state *conn_state;
> +	struct drm_connector *conn;
> +	struct intel_encoder *encoder = NULL;
> +	int i;
> +
> +	if (crtc_state->bigjoiner_slave)
> +		master = crtc_state->bigjoiner_linked_crtc;
> +
> +	master_crtc_state = intel_atomic_get_new_crtc_state(state, master);
> +
> +	for_each_new_connector_in_state(&state->base, conn, conn_state, i) {
> +		if (conn_state->crtc != &master->base)
> +			continue;
> +
> +		encoder = to_intel_encoder(conn_state->best_encoder);
> +		break;
> +	}
> +
> +	if (!crtc_state->bigjoiner_slave) {
> +		/* need to enable VDSC, which we skipped in pre-enable */
> +		intel_dsc_enable(encoder, crtc_state);
> +	} else {
> +		/*
> +		 * Enable sequence steps 1-7 on bigjoiner master
> +		 */
> +		intel_encoders_pre_pll_enable(state, master);
> +		intel_enable_shared_dpll(master_crtc_state);
> +		intel_encoders_pre_enable(state, master);
> +
> +		/* and DSC on slave */
> +		intel_dsc_enable(NULL, crtc_state);
> +	}
> +}
> +
>  static void hsw_crtc_enable(struct intel_atomic_state *state,
>  			    struct intel_crtc *crtc)
>  {
> @@ -7151,35 +7190,40 @@ static void hsw_crtc_enable(struct
> intel_atomic_state *state,
>  	if (drm_WARN_ON(&dev_priv->drm, crtc->active))
>  		return;
> 
> -	intel_encoders_pre_pll_enable(state, crtc);
> +	if (!new_crtc_state->bigjoiner) {
> +		intel_encoders_pre_pll_enable(state, crtc);
> 
> -	if (new_crtc_state->shared_dpll)
> -		intel_enable_shared_dpll(new_crtc_state);
> +		if (new_crtc_state->shared_dpll)
> +			intel_enable_shared_dpll(new_crtc_state);
> 
> -	intel_encoders_pre_enable(state, crtc);
> -
> -	if (!transcoder_is_dsi(cpu_transcoder))
> -		intel_set_transcoder_timings(new_crtc_state);
> -
> -	intel_set_pipe_src_size(new_crtc_state);
> -
> -	if (cpu_transcoder != TRANSCODER_EDP &&
> -	    !transcoder_is_dsi(cpu_transcoder))
> -		intel_de_write(dev_priv, PIPE_MULT(cpu_transcoder),
> -			       new_crtc_state->pixel_multiplier - 1);
> -
> -	if (new_crtc_state->has_pch_encoder)
> -		intel_cpu_transcoder_set_m_n(new_crtc_state,
> -					     &new_crtc_state->fdi_m_n, NULL);
> -
> -	if (!transcoder_is_dsi(cpu_transcoder)) {
> -		hsw_set_frame_start_delay(new_crtc_state);
> -		hsw_set_pipeconf(new_crtc_state);
> +		intel_encoders_pre_enable(state, crtc);
> +	} else {
> +		icl_ddi_bigjoiner_pre_enable(state, new_crtc_state);
>  	}
> 
> +	intel_set_pipe_src_size(new_crtc_state);
>  	if (INTEL_GEN(dev_priv) >= 9 || IS_BROADWELL(dev_priv))
>  		bdw_set_pipemisc(new_crtc_state);
> 
> +	if (!new_crtc_state->bigjoiner_slave ||
> !transcoder_is_dsi(cpu_transcoder)) {
> +		if (!transcoder_is_dsi(cpu_transcoder))
> +			intel_set_transcoder_timings(new_crtc_state);
> +
> +		if (cpu_transcoder != TRANSCODER_EDP &&
> +		    !transcoder_is_dsi(cpu_transcoder))
> +			intel_de_write(dev_priv, PIPE_MULT(cpu_transcoder),
> +				       new_crtc_state->pixel_multiplier - 1);
> +
> +		if (new_crtc_state->has_pch_encoder)
> +			intel_cpu_transcoder_set_m_n(new_crtc_state,
> +						     &new_crtc_state->fdi_m_n,
> NULL);
> +
> +		hsw_set_frame_start_delay(new_crtc_state);
> +	}
> +
> +	if (!transcoder_is_dsi(cpu_transcoder))
> +		hsw_set_pipeconf(new_crtc_state);
> +
>  	crtc->active = true;
> 
>  	/* Display WA #1180: WaDisableScalarClockGating: glk, cnl */ @@ -
> 7214,6 +7258,11 @@ static void hsw_crtc_enable(struct intel_atomic_state
> *state,
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		icl_pipe_mbus_enable(crtc);
> 
> +	if (new_crtc_state->bigjoiner_slave) {
> +		trace_intel_pipe_enable(crtc);
> +		intel_crtc_vblank_on(new_crtc_state);
> +	}
> +
>  	intel_encoders_enable(state, crtc);
> 
>  	if (psl_clkgate_wa) {
> @@ -15669,6 +15718,9 @@ static void intel_enable_crtc(struct
> intel_atomic_state *state,
> 
>  	dev_priv->display.crtc_enable(state, crtc);
> 
> +	if (new_crtc_state->bigjoiner_slave)
> +		return;
> +
>  	/* vblanks work again, re-enable pipe CRC. */
>  	intel_crtc_enable_pipe_crc(crtc);
>  }
> @@ -15731,8 +15783,21 @@ static void intel_old_crtc_state_disables(struct
> intel_atomic_state *state,  {
>  	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> 
> +	drm_WARN_ON(&dev_priv->drm, old_crtc_state->bigjoiner_slave);
> +
>  	intel_crtc_disable_planes(state, crtc);
> 
> +	/*
> +	 * We still need special handling for disabling bigjoiner master
> +	 * and slaves since for slave we do not have encoder or plls
> +	 * so we dont need to disable those.
> +	 */
> +	if (old_crtc_state->bigjoiner) {
> +		intel_crtc_disable_planes(state,
> +					  old_crtc_state-
> >bigjoiner_linked_crtc);
> +		old_crtc_state->bigjoiner_linked_crtc->active = false;
> +	}
> +
>  	/*
>  	 * We need to disable pipe CRC before disabling the pipe,
>  	 * or we race against vblank off.
> @@ -15761,7 +15826,7 @@ static void intel_commit_modeset_disables(struct
> intel_atomic_state *state)
>  	/* Only disable port sync and MST slaves */
>  	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
>  					    new_crtc_state, i) {
> -		if (!needs_modeset(new_crtc_state))
> +		if (!needs_modeset(new_crtc_state) || old_crtc_state-
> >bigjoiner)
>  			continue;
> 
>  		if (!old_crtc_state->hw.active)
> @@ -15786,10 +15851,18 @@ static void
> intel_commit_modeset_disables(struct intel_atomic_state *state)
>  	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
>  					    new_crtc_state, i) {
>  		if (!needs_modeset(new_crtc_state) ||
> -		    (handled & BIT(crtc->pipe)))
> +		    (handled & BIT(crtc->pipe)) ||
> +		    old_crtc_state->bigjoiner_slave)
>  			continue;
> 
>  		intel_pre_plane_update(state, crtc);
> +		if (old_crtc_state->bigjoiner) {
> +			struct intel_crtc *slave =
> +				old_crtc_state->bigjoiner_linked_crtc;
> +
> +			intel_pre_plane_update(state, slave);
> +		}
> +
>  		if (old_crtc_state->hw.active)
>  			intel_old_crtc_state_disables(state, old_crtc_state,
>  						      new_crtc_state, crtc);
> @@ -15887,7 +15960,8 @@ static void skl_commit_modeset_enables(struct
> intel_atomic_state *state)
>  			continue;
> 
>  		if (intel_dp_mst_is_slave_trans(new_crtc_state) ||
> -		    is_trans_port_sync_master(new_crtc_state))
> +		    is_trans_port_sync_master(new_crtc_state) ||
> +		    (new_crtc_state->bigjoiner && !new_crtc_state-
> >bigjoiner_slave))
>  			continue;
> 
>  		modeset_pipes &= ~BIT(pipe);
> @@ -15897,7 +15971,7 @@ static void skl_commit_modeset_enables(struct
> intel_atomic_state *state)
> 
>  	/*
>  	 * Then we enable all remaining pipes that depend on other
> -	 * pipes: MST slaves and port sync masters.
> +	 * pipes: MST slaves and port sync masters, big joiner master
>  	 */
>  	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
>  		enum pipe pipe = crtc->pipe;
> --
> 2.26.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-11-17  9:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 22:03 [Intel-gfx] [PATCH 00/23] drm/i915: Big bigjoiner series Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 01/23] drm/i915: Copy the plane hw state directly for Y planes Ville Syrjala
2020-11-17  9:19   ` Lisovskiy, Stanislav
2020-11-13 22:03 ` [Intel-gfx] [PATCH 02/23] drm/i915: Pass intel_atomic_state around Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 03/23] drm/i915: Nuke intel_atomic_crtc_state_for_each_plane_state() from skl+ wm code Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 04/23] drm/i915: Pimp the watermark documentation a bit Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 05/23] drm/i915: Precompute can_sagv for each wm level Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 06/23] drm/i915: Store plane relative data rate in crtc_state Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 07/23] drm/i915: Remove skl_adjusted_plane_pixel_rate() Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 08/23] drm/i915: Pass intel_atomic_state instead of drm_atomic_state Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 09/23] drm/i915/dp: Add from_crtc_state to copy color blobs Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 10/23] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3 Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 11/23] drm/i915: Try to make bigjoiner work in atomic check Ville Syrjala
2020-11-17  8:28   ` Manna, Animesh
2020-11-13 22:03 ` [Intel-gfx] [PATCH 12/23] drm/i915/dp: Modify VDSC helpers to configure DSC for Bigjoiner slave Ville Syrjala
2020-11-13 22:03 ` [Intel-gfx] [PATCH 13/23] drm/i915/dp: Master/Slave enable/disable sequence for bigjoiner Ville Syrjala
2020-11-17  9:17   ` Manna, Animesh [this message]
2020-11-13 22:03 ` [Intel-gfx] [PATCH 14/23] drm/i915: HW state readout for Bigjoiner case Ville Syrjala
2020-11-17  9:51   ` Manna, Animesh
2020-11-13 22:03 ` [Intel-gfx] [PATCH 15/23] drm/i915: Add crtcs affected by bigjoiner to the state Ville Syrjala
2020-11-16 23:37   ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 16/23] drm/i915: Add planes " Ville Syrjala
2020-11-17  0:09   ` Navare, Manasi
2020-11-17 15:14     ` Ville Syrjälä
2020-11-17 15:50       ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 17/23] drm/i915: Get the uapi state from the correct plane when bigjoiner is used Ville Syrjala
2020-11-17  0:24   ` Navare, Manasi
2020-11-17 15:17     ` Ville Syrjälä
2020-11-17 15:48       ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 18/23] drm/i915: Add bigjoiner aware plane clipping checks Ville Syrjala
2020-11-17 14:54   ` Lisovskiy, Stanislav
2020-11-13 22:03 ` [Intel-gfx] [PATCH 19/23] drm/i915: Add debugfs dumping for bigjoiner, v3 Ville Syrjala
2020-11-17 11:07   ` Manna, Animesh
2020-11-13 22:03 ` [Intel-gfx] [PATCH 20/23] drm/i915: Disable legacy cursor fastpath for bigjoiner Ville Syrjala
2020-11-17  0:27   ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 21/23] drm/i915: Fix cursor src/dst rectangle with bigjoiner Ville Syrjala
2020-11-17  0:33   ` Navare, Manasi
2020-11-17 15:09     ` Ville Syrjälä
2020-11-17 15:52       ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 22/23] drm/i915: Add bigjoiner state dump Ville Syrjala
2020-11-17  0:36   ` Navare, Manasi
2020-11-13 22:03 ` [Intel-gfx] [PATCH 23/23] drm/i915: Enable bigjoiner Ville Syrjala
2020-11-17  0:36   ` Navare, Manasi
2020-11-14  0:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Big bigjoiner series Patchwork
2020-11-14  0:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-11-14  0:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-11-14  4:10 ` [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=787005163f85455790370b0dff9cb506@intel.com \
    --to=animesh.manna@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