From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Manasi Navare <navaremanasi@chromium.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/6] drm/i915: Change intel_pipe_update_{start, end}() calling convention
Date: Tue, 29 Aug 2023 11:27:44 +0300 [thread overview]
Message-ID: <ZO2sAP1MLRUMZOv6@intel.com> (raw)
In-Reply-To: <CAE72mNmgn063MVSr_jS7PDKXxPvw5C6xRdKAVd8WJYrAivBDwQ@mail.gmail.com>
On Mon, Aug 28, 2023 at 11:30:25AM -0700, Manasi Navare wrote:
> On Sun, Aug 27, 2023 at 10:41 PM Ville Syrjala
> <ville.syrjala@linux.intel.com> wrote:
> >
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > We'll need to also look at the old crtc state in
> > intel_pipe_update_start() so change the calling convention to
> > just plumb in the full atomic state instead.
>
> I am guessing we would need the old crtc state to look at if VRR parameters
> were changed?
> Could we elaborate why we would need old crtc state so we better understand this
> change in the patch?
Details are in the patch that does those changes.
>
> Manasi
>
> >
> > Cc: Manasi Navare <navaremanasi@chromium.org>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_crtc.c | 18 ++++++++++++------
> > drivers/gpu/drm/i915/display/intel_crtc.h | 6 ++++--
> > drivers/gpu/drm/i915/display/intel_display.c | 4 ++--
> > 3 files changed, 18 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> > index 5caa928e5ce9..461949b48411 100644
> > --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> > @@ -470,7 +470,8 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode)
> >
> > /**
> > * intel_pipe_update_start() - start update of a set of display registers
> > - * @new_crtc_state: the new crtc state
> > + * @state: the atomic state
> > + * @crtc: the crtc
> > *
> > * Mark the start of an update to pipe registers that should be updated
> > * atomically regarding vblank. If the next vblank will happens within
> > @@ -480,10 +481,12 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode)
> > * until a subsequent call to intel_pipe_update_end(). That is done to
> > * avoid random delays.
> > */
> > -void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state)
> > +void intel_pipe_update_start(struct intel_atomic_state *state,
> > + struct intel_crtc *crtc)
> > {
> > - struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
> > struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> > + struct intel_crtc_state *new_crtc_state =
> > + intel_atomic_get_new_crtc_state(state, crtc);
> > const struct drm_display_mode *adjusted_mode = &new_crtc_state->hw.adjusted_mode;
> > long timeout = msecs_to_jiffies_timeout(1);
> > int scanline, min, max, vblank_start;
> > @@ -631,15 +634,18 @@ static void dbg_vblank_evade(struct intel_crtc *crtc, ktime_t end) {}
> >
> > /**
> > * intel_pipe_update_end() - end update of a set of display registers
> > - * @new_crtc_state: the new crtc state
> > + * @state: the atomic state
> > + * @crtc: the crtc
> > *
> > * Mark the end of an update started with intel_pipe_update_start(). This
> > * re-enables interrupts and verifies the update was actually completed
> > * before a vblank.
> > */
> > -void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
> > +void intel_pipe_update_end(struct intel_atomic_state *state,
> > + struct intel_crtc *crtc)
> > {
> > - struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
> > + struct intel_crtc_state *new_crtc_state =
> > + intel_atomic_get_new_crtc_state(state, crtc);
> > enum pipe pipe = crtc->pipe;
> > int scanline_end = intel_get_crtc_scanline(crtc);
> > u32 end_vbl_count = intel_crtc_get_vblank_counter(crtc);
> > diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h
> > index 51a4c8df9e65..22d7993d1f0b 100644
> > --- a/drivers/gpu/drm/i915/display/intel_crtc.h
> > +++ b/drivers/gpu/drm/i915/display/intel_crtc.h
> > @@ -36,8 +36,10 @@ void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
> > u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
> > void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state);
> > void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
> > -void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state);
> > -void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
> > +void intel_pipe_update_start(struct intel_atomic_state *state,
> > + struct intel_crtc *crtc);
> > +void intel_pipe_update_end(struct intel_atomic_state *state,
> > + struct intel_crtc *crtc);
> > void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
> > struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915);
> > struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index f6397462e4c2..cfad967b5684 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -6559,7 +6559,7 @@ static void intel_update_crtc(struct intel_atomic_state *state,
> > intel_crtc_planes_update_noarm(state, crtc);
> >
> > /* Perform vblank evasion around commit operation */
> > - intel_pipe_update_start(new_crtc_state);
> > + intel_pipe_update_start(state, crtc);
> >
> > commit_pipe_pre_planes(state, crtc);
> >
> > @@ -6567,7 +6567,7 @@ static void intel_update_crtc(struct intel_atomic_state *state,
> >
> > commit_pipe_post_planes(state, crtc);
> >
> > - intel_pipe_update_end(new_crtc_state);
> > + intel_pipe_update_end(state, crtc);
> >
> > /*
> > * We usually enable FIFO underrun interrupts as part of the
> > --
> > 2.41.0
> >
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-08-29 8:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 5:41 [Intel-gfx] [PATCH 0/6] drm/i915: VRR and M/N stuff Ville Syrjala
2023-08-28 5:41 ` [Intel-gfx] [PATCH 1/6] drm/i915: Move psr unlock out from the pipe update critical section Ville Syrjala
2023-08-28 18:16 ` Manasi Navare
2023-08-29 8:23 ` Ville Syrjälä
2023-08-28 5:41 ` [Intel-gfx] [PATCH 2/6] drm/i915: Change intel_pipe_update_{start, end}() calling convention Ville Syrjala
2023-08-28 18:30 ` Manasi Navare
2023-08-29 8:27 ` Ville Syrjälä [this message]
2023-08-28 5:41 ` [Intel-gfx] [PATCH 3/6] drm/i915: Extract intel_crtc_vblank_evade_scanlines() Ville Syrjala
2023-08-28 18:31 ` Manasi Navare
2023-08-28 5:41 ` [Intel-gfx] [PATCH 4/6] drm/i915: Enable VRR later during fastsets Ville Syrjala
2023-08-28 18:47 ` Manasi Navare
2023-08-29 8:26 ` Ville Syrjälä
2023-08-29 14:58 ` Manasi Navare
2023-08-30 5:12 ` Ville Syrjälä
2023-09-11 18:21 ` Golani, Mitulkumar Ajitkumar
2023-08-28 5:41 ` [Intel-gfx] [PATCH 5/6] drm/i915: Adjust seamless_m_n flag behaviour Ville Syrjala
2023-08-28 16:58 ` Golani, Mitulkumar Ajitkumar
2023-08-29 8:20 ` Ville Syrjälä
2023-08-29 13:48 ` Golani, Mitulkumar Ajitkumar
2023-08-30 5:16 ` Ville Syrjälä
2023-08-30 6:51 ` Golani, Mitulkumar Ajitkumar
2023-08-30 6:58 ` Ville Syrjälä
2023-08-30 7:32 ` Golani, Mitulkumar Ajitkumar
2023-08-28 5:41 ` [Intel-gfx] [PATCH 6/6] drm/i915: Optimize out redundant M/N updates Ville Syrjala
2023-08-28 6:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: VRR and M/N stuff Patchwork
2023-08-28 6:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-28 8:03 ` [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=ZO2sAP1MLRUMZOv6@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=navaremanasi@chromium.org \
/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