public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 02/12] drm/i915: Make the CRTC state consistent during sanitize-disabling
Date: Tue, 9 May 2023 21:28:36 +0300	[thread overview]
Message-ID: <ZFqQ1J2m80cGlK11@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <ZFpci-SrvB0-9UYr@intel.com>

On Tue, May 09, 2023 at 05:45:31PM +0300, Ville Syrjälä wrote:
> On Fri, May 05, 2023 at 11:46:04PM +0300, Imre Deak wrote:
> > Make sure that the CRTC state is reset correctly, as expected after
> > disabling the CRTC.
> > 
> > In particular this change will:
> > - Zero all the CSC blob pointers after intel_crtc_free_hw_state()
> >   has freed them.
> > - Zero the shared DPLL and port PLL pointers and clear the
> >   corresponding CRTC reference flag in the PLL state.
> > - Reset all the transcoder and pipe fields.
> > 
> > v2:
> > - Reset fully the CRTC state. (Ville)
> > - Clear pipe active flags in the DPLL state.
> > 
> > v3:
> > - Clear only the CRTC reference flag and add a helper for this.
> >   (Ville)
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 23 +++++++++++++------
> >  drivers/gpu/drm/i915/display/intel_dpll_mgr.h |  3 +++
> >  .../drm/i915/display/intel_modeset_setup.c    | 13 ++++++-----
> >  3 files changed, 26 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> > index ed372d227aa73..e436127bfe94e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> > @@ -374,22 +374,31 @@ intel_reference_shared_dpll(struct intel_atomic_state *state,
> >  		    crtc->base.base.id, crtc->base.name, pll->info->name);
> >  }
> 
> Can you do the same for the reference counterpart for symmetry?

Yes, makes sense.

> I'd also split this refactoring from the functional stuff.

Ok. Patch 12 v3 also has an issue I noticed/commented on only after
sending it, if there's no other feedback on that one, I'll resend the
patchset with the above two also updated.

> With that
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> > +void
> > +intel_unreference_shared_dpll_crtc(const struct intel_crtc *crtc,
> > +				   const struct intel_shared_dpll *pll,
> > +				   struct intel_shared_dpll_state *shared_dpll_state)
> > +{
> > +	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> > +
> > +	drm_WARN_ON(&i915->drm, (shared_dpll_state->pipe_mask & BIT(crtc->pipe)) == 0);
> > +
> > +	shared_dpll_state->pipe_mask &= ~BIT(crtc->pipe);
> > +
> > +	drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] releasing %s\n",
> > +		    crtc->base.base.id, crtc->base.name, pll->info->name);
> > +}
> > +
> >  static void intel_unreference_shared_dpll(struct intel_atomic_state *state,
> >  					  const struct intel_crtc *crtc,
> >  					  const struct intel_shared_dpll *pll)
> >  {
> > -	struct drm_i915_private *i915 = to_i915(state->base.dev);
> >  	struct intel_shared_dpll_state *shared_dpll;
> >  	const enum intel_dpll_id id = pll->info->id;
> >  
> >  	shared_dpll = intel_atomic_get_shared_dpll_state(&state->base);
> >  
> > -	drm_WARN_ON(&i915->drm, (shared_dpll[id].pipe_mask & BIT(crtc->pipe)) == 0);
> > -
> > -	shared_dpll[id].pipe_mask &= ~BIT(crtc->pipe);
> > -
> > -	drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] releasing %s\n",
> > -		    crtc->base.base.id, crtc->base.name, pll->info->name);
> > +	intel_unreference_shared_dpll_crtc(crtc, pll, &shared_dpll[id]);
> >  }
> >  
> >  static void intel_put_dpll(struct intel_atomic_state *state,
> > diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> > index 3854f1b4299ac..ba62eb5d7c517 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> > +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> > @@ -341,6 +341,9 @@ int intel_reserve_shared_dplls(struct intel_atomic_state *state,
> >  			       struct intel_encoder *encoder);
> >  void intel_release_shared_dplls(struct intel_atomic_state *state,
> >  				struct intel_crtc *crtc);
> > +void intel_unreference_shared_dpll_crtc(const struct intel_crtc *crtc,
> > +					const struct intel_shared_dpll *pll,
> > +					struct intel_shared_dpll_state *shared_dpll_state);
> >  void icl_set_active_port_dpll(struct intel_crtc_state *crtc_state,
> >  			      enum icl_port_dpll_id port_dpll_id);
> >  void intel_update_active_dpll(struct intel_atomic_state *state,
> > diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> > index eefa4018dc0c2..6e55806bbe066 100644
> > --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> > +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> > @@ -88,13 +88,14 @@ static void intel_crtc_disable_noatomic(struct intel_crtc *crtc,
> >  	crtc->active = false;
> >  	crtc->base.enabled = false;
> >  
> > -	drm_WARN_ON(&i915->drm,
> > -		    drm_atomic_set_mode_for_crtc(&crtc_state->uapi, NULL) < 0);
> > -	crtc_state->uapi.active = false;
> > -	crtc_state->uapi.connector_mask = 0;
> > -	crtc_state->uapi.encoder_mask = 0;
> > +	if (crtc_state->shared_dpll)
> > +		intel_unreference_shared_dpll_crtc(crtc,
> > +						   crtc_state->shared_dpll,
> > +						   &crtc_state->shared_dpll->state);
> > +
> > +	__drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi);
> >  	intel_crtc_free_hw_state(crtc_state);
> > -	memset(&crtc_state->hw, 0, sizeof(crtc_state->hw));
> > +	intel_crtc_state_reset(crtc_state, crtc);
> >  
> >  	for_each_encoder_on_crtc(&i915->drm, &crtc->base, encoder)
> >  		encoder->base.crtc = NULL;
> > -- 
> > 2.37.2
> 
> -- 
> Ville Syrjälä
> Intel

  reply	other threads:[~2023-05-09 18:28 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 23:10 [Intel-gfx] [PATCH v2 00/12] drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue Imre Deak
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 01/12] drm/i915: Fix PIPEDMC disabling for a bigjoiner configuration Imre Deak
2023-05-04 14:39   ` Ville Syrjälä
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 02/12] drm/i915: Make the CRTC state consistent during sanitize-disabling Imre Deak
2023-05-04 14:38   ` Ville Syrjälä
2023-05-04 17:08     ` Imre Deak
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-09 14:45     ` Ville Syrjälä
2023-05-09 18:28       ` Imre Deak [this message]
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 03/12] drm/i915: Update connector atomic state before crtc sanitize-disabling Imre Deak
2023-05-04 14:42   ` Ville Syrjälä
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 04/12] drm/i915: Separate intel_crtc_disable_noatomic_begin/complete() Imre Deak
2023-05-04 17:15   ` Ville Syrjälä
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 05/12] drm/i915: Factor out set_encoder_for_connector() Imre Deak
2023-05-04 14:48   ` Ville Syrjälä
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 06/12] drm/i915: Add support for disabling any CRTCs during HW readout/sanitization Imre Deak
2023-05-04 17:15   ` Ville Syrjälä
2023-05-04 20:29     ` Imre Deak
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 07/12] drm/i915/dp: Add link training debug and error printing helpers Imre Deak
2023-05-04 14:53   ` Ville Syrjälä
2023-05-05  8:51     ` Jani Nikula
2023-05-05 12:07       ` Imre Deak
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 08/12] drm/i915/dp: Convert link training error to debug message on disconnected sink Imre Deak
2023-05-04 14:54   ` Ville Syrjälä
2023-05-05  8:22   ` Govindapillai, Vinod
2023-05-05 12:12     ` Imre Deak
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-09 12:26     ` Govindapillai, Vinod
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 09/12] drm/i915/dp: Prevent link training fallback on disconnected port Imre Deak
2023-05-04 14:54   ` Ville Syrjälä
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-09 12:26     ` Govindapillai, Vinod
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 10/12] drm/i915/dp: Factor out intel_dp_get_active_pipes() Imre Deak
2023-05-04 14:55   ` Ville Syrjälä
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 11/12] drm/i915: Factor out a helper for handling atomic modeset locks/state Imre Deak
2023-05-04 15:00   ` Ville Syrjälä
2023-05-03 23:10 ` [Intel-gfx] [PATCH v2 12/12] drm/i915/tc: Reset TypeC PHYs left enabled in DP-alt mode after the sink disconnects Imre Deak
2023-05-04 17:41   ` Ville Syrjälä
2023-05-04 20:12     ` Imre Deak
2023-05-05 20:46   ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-05-05 22:12     ` Imre Deak
2023-05-04  0:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue (rev2) Patchwork
2023-05-04  0:21 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-04  0:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-04  2:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-05-05 21:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue (rev10) Patchwork
2023-05-05 21:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-05 22:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-06 16:34 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=ZFqQ1J2m80cGlK11@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