From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 05/11] drm/i915: Add support for disabling any CRTCs during HW readout/sanitization
Date: Sat, 29 Apr 2023 10:50:26 +0300 [thread overview]
Message-ID: <ZEzMQjoV3ArbzB/z@ideak-desk> (raw)
In-Reply-To: <ZEwGqwjbTtqHWwGr@ideak-desk.fi.intel.com>
On Fri, Apr 28, 2023 at 08:47:23PM +0300, Imre Deak wrote:
> On Fri, Apr 28, 2023 at 08:22:54PM +0300, Imre Deak wrote:
> > On Fri, Apr 28, 2023 at 05:02:35PM +0300, Ville Syrjälä wrote:
> > > On Wed, Apr 26, 2023 at 07:52:59PM +0300, Imre Deak wrote:
> > > > [...]
> > > > +static u32 get_transcoder_pipes(struct drm_i915_private *i915, u32 transcoder_mask)
> > > > +{
> > > > + struct intel_crtc *slave_crtc;
> > > > + u32 pipes = 0;
> > > > +
> > > > + for_each_intel_crtc(&i915->drm, slave_crtc) {
> > > > + struct intel_crtc_state *slave_crtc_state =
> > > > + to_intel_crtc_state(slave_crtc->base.state);
> > > > +
> > > > + if (slave_crtc_state->cpu_transcoder == INVALID_TRANSCODER)
> > > > + continue;
> > > > +
> > > > + if (transcoder_mask & BIT(slave_crtc_state->cpu_transcoder))
> > > > + pipes |= BIT(slave_crtc->pipe);
> > > > + }
> > > > +
> > > > + return pipes;
> > > > +}
> > > > +
> > > > +static u32 get_bigjoiner_slave_pipes(struct drm_i915_private *i915, u32 master_pipes)
> > > > +{
> > > > + struct intel_crtc *master_crtc;
> > > > + u32 pipes = 0;
> > > > +
> > > > + for_each_intel_crtc_in_pipe_mask(&i915->drm, master_crtc, master_pipes) {
> > > > + struct intel_crtc_state *master_crtc_state =
> > > > + to_intel_crtc_state(master_crtc->base.state);
> > > > +
> > > > + pipes |= intel_crtc_bigjoiner_slave_pipes(master_crtc_state);
> > > > + }
> > > > +
> > > > + return pipes;
> > > > +}
> > > > +
> > > > +static void kill_bigjoiner_slave_noatomic(struct intel_crtc *master_crtc)
> > > > +{
> > > > + struct drm_i915_private *i915 = to_i915(master_crtc->base.dev);
> > > > + struct intel_crtc_state *master_crtc_state =
> > > > + to_intel_crtc_state(master_crtc->base.state);
> > > > + struct intel_crtc *slave_crtc;
> > > > +
> > > > + for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
> > > > + intel_crtc_bigjoiner_slave_pipes(master_crtc_state)) {
> > > > + struct intel_crtc_state *slave_crtc_state =
> > > > + to_intel_crtc_state(slave_crtc->base.state);
> > > > +
> > > > + slave_crtc_state->bigjoiner_pipes = 0;
> > > > + }
> > > > +
> > > > + master_crtc_state->bigjoiner_pipes = 0;
> > > > +}
> > > > +
> > > > +static void disable_crtc_with_slaves(struct intel_crtc *crtc,
> > > > + struct drm_modeset_acquire_ctx *ctx)
> > > > +{
> > > > + struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> > > > + struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state);
> > > > + u32 bigjoiner_masters = BIT(crtc->pipe) |
> > > > + get_transcoder_pipes(i915, crtc_state->sync_mode_slaves_mask);
> > >
> > > The resulting bitmask would seem to also include the bigjoiner slaves.
> >
> > Hrm, doesn't sync_mode_slaves_mask contain only the transcoder bits for
> > the port-synced master CRTCs? I assumed that those port-synced master
> > CRTCs would point to their slave pipes via their
> > crtc_state->bigjoiner_pipes mask.
>
> Ah, understood the issue, the port_synced slave CRTCs need to get
> disabled before the port_sync master.
>
> So I think the following gives the correct order:
>
> u32 portsync_slaves = get_transcoder_pipes(i915,
> crtc_state->sync_mode_slaves_mask);
> u32 bigjoiner_slaves = get_bigjoiner_slave_pipes(i915,
> BIT(crtc->pipe) |
> portsync_slaves);
>
> for_each_intel_crtc_in_pipe_mask(&i915->drm, temp_crtc, bigjoiner_slaves)
> intel_crtc_disable_noatomic(temp_crtc, ctx);
>
> for_each_intel_crtc_in_pipe_mask(&i915->drm, temp_crtc, portsync_slaves) {
> intel_crtc_disable_noatomic(temp_crtc, ctx);
> kill_bigjoiner_slave_noatomic(temp_crtc);
> }
>
> intel_crtc_disable_noatomic(crtc);
> kill_bigjoiner_slave_noatomic(crtc);
>
> ?
And that a bigjoiner slave pipe's transcoder points to the master
transcoder :/ so those slave pipes need to be filtered out in
get_transcoder_pipes().
> > > > + u32 bigjoiner_slaves = get_bigjoiner_slave_pipes(i915, bigjoiner_masters);
> > > > + struct intel_crtc *temp_crtc;
> > > > +
> > > > + for_each_intel_crtc_in_pipe_mask(&i915->drm, temp_crtc, bigjoiner_slaves)
> > > > + intel_crtc_disable_noatomic(temp_crtc, ctx);
> > > > +
> > > > + for_each_intel_crtc_in_pipe_mask(&i915->drm, temp_crtc, bigjoiner_masters) {
> > > > + intel_crtc_disable_noatomic(temp_crtc, ctx);
> > > > + kill_bigjoiner_slave_noatomic(temp_crtc);
> > > > + }
> > > > +}
> > > > +
> > > > static void intel_sanitize_crtc(struct intel_crtc *crtc,
> > > > struct drm_modeset_acquire_ctx *ctx)
> > > > {
> > > > @@ -299,10 +404,11 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
> > > > /*
> > > > * Adjust the state of the output pipe according to whether we have
> > > > * active connectors/encoders.
> > > > + * TODO: Add support for MST
> > > > */
> > > > if (crtc_state->hw.active && !intel_crtc_has_encoders(crtc) &&
> > > > !intel_crtc_is_bigjoiner_slave(crtc_state))
> > > > - intel_crtc_disable_noatomic(crtc, ctx);
> > > > + disable_crtc_with_slaves(crtc, ctx);
> > >
> > > I'd like to keep the _noatomic() in the name.
> >
> > Ok, will change this.
> >
> > >
> > > > }
> > > >
> > > > static bool has_bogus_dpll_config(const struct intel_crtc_state *crtc_state)
> > > > --
> > > > 2.37.2
> > >
> > > --
> > > Ville Syrjälä
> > > Intel
next prev parent reply other threads:[~2023-04-29 7:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 16:52 [Intel-gfx] [PATCH 00/11] drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 01/11] drm/i915: Fix PIPEDMC disabling for a bigjoiner configuration Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 02/11] drm/i915: Make the CRTC wrt. CSC state consistent during sanitize-disabling Imre Deak
2023-04-26 17:48 ` Ville Syrjälä
2023-04-26 19:51 ` Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 03/11] drm/i915: Update connector atomic state before crtc sanitize-disabling Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 04/11] drm/i915: Factor out set_encoder_for_connector() Imre Deak
2023-04-26 16:52 ` [Intel-gfx] [PATCH 05/11] drm/i915: Add support for disabling any CRTCs during HW readout/sanitization Imre Deak
2023-04-28 14:02 ` Ville Syrjälä
2023-04-28 17:22 ` Imre Deak
2023-04-28 17:47 ` Imre Deak
2023-04-29 7:50 ` Imre Deak [this message]
2023-04-26 16:53 ` [Intel-gfx] [PATCH 06/11] drm/i915/dp: Add link training debug and error printing helpers Imre Deak
2023-04-28 14:21 ` Ville Syrjälä
2023-04-28 19:30 ` Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 07/11] drm/i915/dp: Convert link training error to debug message on disconnected sink Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 08/11] drm/i915/dp: Prevent link training fallback on disconnected port Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 09/11] drm/i915/dp: Factor out intel_dp_get_active_pipes() Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 10/11] drm/i915: Factor out call_with_modeset_ctx() Imre Deak
2023-04-28 14:32 ` Ville Syrjälä
2023-04-28 18:34 ` Imre Deak
2023-04-26 16:53 ` [Intel-gfx] [PATCH 11/11] drm/i915/tc: Reset TypeC PHYs left enabled in DP-alt mode after the sink disconnects Imre Deak
2023-04-26 19:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Add a workaround for an IOM/TCSS firmware hang issue Patchwork
2023-04-26 19:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-26 22:09 ` [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=ZEzMQjoV3ArbzB/z@ideak-desk \
--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