From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 10/11] drm/i915: Push audio_{enable, disable}() to the pre/post pane update stage
Date: Tue, 14 Nov 2023 10:57:29 +0200 [thread overview]
Message-ID: <ZVM2eebisBtZ_88k@intel.com> (raw)
In-Reply-To: <87leb1tzzn.fsf@intel.com>
On Mon, Nov 13, 2023 at 05:49:32PM +0200, Jani Nikula wrote:
> On Mon, 06 Nov 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Relocate the audio enable/disable from the full modeset hooks into
> > the common pre/post plane update stage of the commit. Audio fastset
> > is within easy reach now.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 31 +++++++++++++++-----
> > 1 file changed, 24 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index d606befa007c..98d4fcd28073 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -990,6 +990,24 @@ static bool vrr_disabling(const struct intel_crtc_state *old_crtc_state,
> > vrr_params_changed(old_crtc_state, new_crtc_state)));
> > }
> >
> > +static bool audio_enabling(const struct intel_crtc_state *old_crtc_state,
> > + const struct intel_crtc_state *new_crtc_state)
> > +{
> > + if (!new_crtc_state->hw.active)
> > + return false;
>
> Makes me wonder if these check should've been added to the
> is_enabling/is_disabling macros instead. *shrug*
I had it like that originally, but then I decided against it for
some reason that I seem to have forgotten already...
I *think* I was planning to use is_{enabling,disabling}() in some
other context where that check doesn't make sense. But I think in
the end I convinced myself that I can't actually do that due to
other reasons. So yeah, putting these into is_{enabling,disabling}()
would probably make sense. But I think I'll have to mull it over a
bit more.
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Thanks.
>
>
> > +
> > + return is_enabling(has_audio, old_crtc_state, new_crtc_state);
> > +}
> > +
> > +static bool audio_disabling(const struct intel_crtc_state *old_crtc_state,
> > + const struct intel_crtc_state *new_crtc_state)
> > +{
> > + if (!old_crtc_state->hw.active)
> > + return false;
> > +
> > + return is_disabling(has_audio, old_crtc_state, new_crtc_state);
> > +}
> > +
> > #undef is_disabling
> > #undef is_enabling
> >
> > @@ -1030,6 +1048,9 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
> >
> > if (intel_crtc_needs_color_update(new_crtc_state))
> > intel_color_post_update(new_crtc_state);
> > +
> > + if (audio_enabling(old_crtc_state, new_crtc_state))
> > + intel_encoders_audio_enable(state, crtc);
> > }
> >
> > static void intel_crtc_enable_flip_done(struct intel_atomic_state *state,
> > @@ -1113,6 +1134,9 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
> > intel_crtc_update_active_timings(old_crtc_state, false);
> > }
> >
> > + if (audio_disabling(old_crtc_state, new_crtc_state))
> > + intel_encoders_audio_disable(state, crtc);
> > +
> > intel_drrs_deactivate(old_crtc_state);
> >
> > intel_psr_pre_plane_update(state, crtc);
> > @@ -1503,7 +1527,6 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,
> > intel_crtc_vblank_on(new_crtc_state);
> >
> > intel_encoders_enable(state, crtc);
> > - intel_encoders_audio_enable(state, crtc);
> >
> > if (HAS_PCH_CPT(dev_priv))
> > intel_wait_for_pipe_scanline_moving(crtc);
> > @@ -1677,7 +1700,6 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
> > intel_crtc_vblank_on(new_crtc_state);
> >
> > intel_encoders_enable(state, crtc);
> > - intel_encoders_audio_enable(state, crtc);
> >
> > if (psl_clkgate_wa) {
> > intel_crtc_wait_for_next_vblank(crtc);
> > @@ -1729,7 +1751,6 @@ static void ilk_crtc_disable(struct intel_atomic_state *state,
> > intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
> > intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, false);
> >
> > - intel_encoders_audio_disable(state, crtc);
> > intel_encoders_disable(state, crtc);
> >
> > intel_crtc_vblank_off(old_crtc_state);
> > @@ -1764,7 +1785,6 @@ static void hsw_crtc_disable(struct intel_atomic_state *state,
> > * Need care with mst->ddi interactions.
> > */
> > if (!intel_crtc_is_bigjoiner_slave(old_crtc_state)) {
> > - intel_encoders_audio_disable(state, crtc);
> > intel_encoders_disable(state, crtc);
> > intel_encoders_post_disable(state, crtc);
> > }
> > @@ -2034,7 +2054,6 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,
> > intel_crtc_vblank_on(new_crtc_state);
> >
> > intel_encoders_enable(state, crtc);
> > - intel_encoders_audio_enable(state, crtc);
> > }
> >
> > static void i9xx_crtc_enable(struct intel_atomic_state *state,
> > @@ -2076,7 +2095,6 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,
> > intel_crtc_vblank_on(new_crtc_state);
> >
> > intel_encoders_enable(state, crtc);
> > - intel_encoders_audio_enable(state, crtc);
> >
> > /* prevents spurious underruns */
> > if (DISPLAY_VER(dev_priv) == 2)
> > @@ -2113,7 +2131,6 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
> > if (DISPLAY_VER(dev_priv) == 2)
> > intel_crtc_wait_for_next_vblank(crtc);
> >
> > - intel_encoders_audio_disable(state, crtc);
> > intel_encoders_disable(state, crtc);
> >
> > intel_crtc_vblank_off(old_crtc_state);
>
> --
> Jani Nikula, Intel
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-11-14 8:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 21:19 [Intel-gfx] [PATCH 00/11] drm/i915: Audio fastset, and some fixes Ville Syrjala
2023-11-06 21:19 ` [Intel-gfx] [PATCH 01/11] drm/i915: Check pipe active state in {planes, vrr}_{enabling, disabling}() Ville Syrjala
2023-11-13 15:31 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 02/11] drm/i915: Call intel_pre_plane_updates() also for pipes getting enabled Ville Syrjala
2023-11-13 15:33 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 03/11] drm/i915: Polish some RMWs Ville Syrjala
2023-11-13 15:34 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 04/11] drm/i915: Push audio enable/disable further out Ville Syrjala
2023-11-13 15:35 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 05/11] drm/i915: Wrap g4x+ DP/HDMI audio enable/disable Ville Syrjala
2023-11-13 15:38 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 06/11] drm/i915: Split g4x+ DP audio presence detect from port enable Ville Syrjala
2023-11-13 15:39 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 07/11] drm/i915: Split g4x+ HDMI " Ville Syrjala
2023-11-13 15:41 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 08/11] drm/i915: Convert audio enable/disable into encoder vfuncs Ville Syrjala
2023-11-13 15:43 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 09/11] drm/i915: Hoist the encoder->audio_{enable, disable}() calls higher up Ville Syrjala
2023-11-13 15:47 ` Jani Nikula
2023-11-13 15:47 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 10/11] drm/i915: Push audio_{enable, disable}() to the pre/post pane update stage Ville Syrjala
2023-11-13 15:49 ` Jani Nikula
2023-11-14 8:57 ` Ville Syrjälä [this message]
2023-11-15 8:26 ` Ville Syrjälä
2023-11-15 8:31 ` Jani Nikula
2023-11-06 21:19 ` [Intel-gfx] [PATCH 11/11] drm/i915: Implement audio fastset Ville Syrjala
2023-11-13 15:51 ` Jani Nikula
2023-11-06 23:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Audio fastset, and some fixes Patchwork
2023-11-06 23:29 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-11-13 21:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Audio fastset, and some fixes (rev2) 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=ZVM2eebisBtZ_88k@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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 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.