[PATCH v4 04/21] drm/i915/dsb: Garbage collect the MMIO DEwake stuff
Shankar, Uma
uma.shankar at intel.com
Tue Jun 10 21:41:47 UTC 2025
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Monday, June 9, 2025 7:40 PM
> To: intel-gfx at lists.freedesktop.org
> Cc: intel-xe at lists.freedesktop.org
> Subject: [PATCH v4 04/21] drm/i915/dsb: Garbage collect the MMIO DEwake stuff
>
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Since the introduction of DSB chaining we no longer need the DEwake tricks in
> intel_dsb_commit().
>
> I also need to relocate the DSB_PMCTRL* writes out of
> intel_dsb_finish() (due to the flip queue DMC vs. DSB register corruption issues),
> and it'll be a bit more straightforward if I don't have to worry about the non-chained
> DSB path anymore.
Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar at intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 4 +-
> drivers/gpu/drm/i915/display/intel_dsb.c | 45 ++++----------------
> drivers/gpu/drm/i915/display/intel_dsb.h | 3 +-
> 3 files changed, 11 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index b0c7c46ffbe2..6ec786198f43 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6748,13 +6748,13 @@ static void intel_update_crtc(struct
> intel_atomic_state *state,
> if (new_crtc_state->use_dsb) {
> intel_crtc_prepare_vblank_event(new_crtc_state, &crtc-
> >dsb_event);
>
> - intel_dsb_commit(new_crtc_state->dsb_commit, false);
> + intel_dsb_commit(new_crtc_state->dsb_commit);
> } else {
> /* Perform vblank evasion around commit operation */
> intel_pipe_update_start(state, crtc);
>
> if (new_crtc_state->dsb_commit)
> - intel_dsb_commit(new_crtc_state->dsb_commit, false);
> + intel_dsb_commit(new_crtc_state->dsb_commit);
>
> commit_pipe_pre_planes(state, crtc);
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c
> b/drivers/gpu/drm/i915/display/intel_dsb.c
> index c8011f5e4076..200555a9e94b 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> @@ -826,8 +826,13 @@ void intel_dsb_wait_vblank_delay(struct
> intel_atomic_state *state,
> intel_dsb_wait_usec(dsb, usecs);
> }
>
> -static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
> - int hw_dewake_scanline)
> +/**
> + * intel_dsb_commit() - Trigger workload execution of DSB.
> + * @dsb: DSB context
> + *
> + * This function is used to do actual write to hardware using DSB.
> + */
> +void intel_dsb_commit(struct intel_dsb *dsb)
> {
> struct intel_crtc *crtc = dsb->crtc;
> struct intel_display *display = to_intel_display(crtc->base.dev); @@ -
> 843,7 +848,7 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
> }
>
> intel_de_write_fw(display, DSB_CTRL(pipe, dsb->id),
> - ctrl | DSB_ENABLE);
> + DSB_ENABLE);
>
> intel_de_write_fw(display, DSB_CHICKEN(pipe, dsb->id),
> dsb->chicken);
> @@ -855,44 +860,10 @@ static void _intel_dsb_commit(struct intel_dsb *dsb,
> u32 ctrl,
> intel_de_write_fw(display, DSB_HEAD(pipe, dsb->id),
> intel_dsb_head(dsb));
>
> - if (hw_dewake_scanline >= 0) {
> - int diff, position;
> -
> - intel_de_write_fw(display, DSB_PMCTRL(pipe, dsb->id),
> - DSB_ENABLE_DEWAKE |
> -
> DSB_SCANLINE_FOR_DEWAKE(hw_dewake_scanline));
> -
> - /*
> - * Force DEwake immediately if we're already past
> - * or close to racing past the target scanline.
> - */
> - position = intel_de_read_fw(display, PIPEDSL(display, pipe)) &
> PIPEDSL_LINE_MASK;
> -
> - diff = hw_dewake_scanline - position;
> - intel_de_write_fw(display, DSB_PMCTRL_2(pipe, dsb->id),
> - (diff >= 0 && diff < 5 ? DSB_FORCE_DEWAKE :
> 0) |
> - DSB_BLOCK_DEWAKE_EXTENSION);
> - }
> -
> intel_de_write_fw(display, DSB_TAIL(pipe, dsb->id),
> intel_dsb_tail(dsb));
> }
>
> -/**
> - * intel_dsb_commit() - Trigger workload execution of DSB.
> - * @dsb: DSB context
> - * @wait_for_vblank: wait for vblank before executing
> - *
> - * This function is used to do actual write to hardware using DSB.
> - */
> -void intel_dsb_commit(struct intel_dsb *dsb,
> - bool wait_for_vblank)
> -{
> - _intel_dsb_commit(dsb,
> - wait_for_vblank ? DSB_WAIT_FOR_VBLANK : 0,
> - wait_for_vblank ? dsb->hw_dewake_scanline : -1);
> -}
> -
> void intel_dsb_wait(struct intel_dsb *dsb) {
> struct intel_crtc *crtc = dsb->crtc;
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.h
> b/drivers/gpu/drm/i915/display/intel_dsb.h
> index 6bcfb03f3415..c8f4499916eb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.h
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.h
> @@ -68,8 +68,7 @@ void intel_dsb_chain(struct intel_atomic_state *state,
> struct intel_dsb *chained_dsb,
> bool wait_for_vblank);
>
> -void intel_dsb_commit(struct intel_dsb *dsb,
> - bool wait_for_vblank);
> +void intel_dsb_commit(struct intel_dsb *dsb);
> void intel_dsb_wait(struct intel_dsb *dsb);
>
> void intel_dsb_irq_handler(struct intel_display *display,
> --
> 2.49.0
More information about the Intel-gfx
mailing list