Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 5/7] drm/i915/dsb: Update previous instruction tracking in intel_dsb_align_tail() & co.
Date: Tue, 17 Nov 2026 20:55:27 +0200	[thread overview]
Message-ID: <avyjH8wbhxceMqop@intel.com> (raw)
In-Reply-To: <avyf1MMGU1uDRARb@intel.com>

On Tue, Nov 17, 2026 at 08:41:24PM +0200, Ville Syrjälä wrote:
> On Tue, Nov 17, 2026 at 06:07:15PM +0200, Jani Nikula wrote:
> > On Mon, 16 Nov 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > intel_dsb_align_tail() and intel_dsb_gosub_align() simply memset
> > > a bunch of QWs to 0. What that actually does is emit a bunch of
> > > NOOP instructions. For complete correctness let's keep the
> > > previous instruction tracking up to date, instead of leaving
> > > it pointing at whatever instruction preceded the alignment
> > > NOOPs.
> > >
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_dsb.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
> > > index 75f98b31c780..f8ca64a3c076 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> > > @@ -601,6 +601,8 @@ static void intel_dsb_align_tail(struct intel_dsb *dsb)
> > >  	if (aligned_tail > tail) {
> > >  		dsb_buffer_fill(dsb, dsb->free_pos, 0, aligned_tail - tail);
> > >  		dsb->free_pos = aligned_tail / 4;
> > > +
> > > +		intel_dsb_set_ins(dsb, dsb->free_pos - 2, 0, 0);
> > 
> > So is this just the last two NOOPs?
> 
> free_pos is in DW units, each instruction is 2 DWs. So this just points
> at the last NOOP emitted as alignment.

I suppose the other option would be to replace the with
raw buffer fill with intel_dsb_noop(). That will currently
emit the NOOPs individually, but we could move the raw buffer
fill into intel_dsb_noop() as an optimization. Then this
instruction tracking magic would live only in one place.

In fact intel_dsb_gosub_finish() already uses intel_dsb_noop()
for the "emit a full cacheline of NOOPs" workaround. So I guess
we should just make everyone use it.

> 
> > 
> > BR,
> > Jani.
> > 
> > >  	}
> > >  }
> > >  
> > > @@ -624,6 +626,8 @@ static void intel_dsb_gosub_align(struct intel_dsb *dsb)
> > >  	if (aligned_tail - tail <= 2 * 8) {
> > >  		dsb_buffer_fill(dsb, dsb->free_pos, 0, aligned_tail - tail);
> > >  		dsb->free_pos = aligned_tail / 4;
> > > +
> > > +		intel_dsb_set_ins(dsb, dsb->free_pos - 2, 0, 0);
> > >  	}
> > >  }
> > 
> > -- 
> > Jani Nikula, Intel
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-11-17 18:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  8:10 [PATCH 0/7] drm/i915/dsb: Optimize indexed register writes Ville Syrjala
2026-11-16  8:10 ` [PATCH 1/7] drm/i915/dsb: Remove old comment about stale contents of the DSB buffer Ville Syrjala
2026-11-17 15:43   ` Jani Nikula
2026-11-16  8:10 ` [PATCH 2/7] drm/i915/dsb: Eliminate intel_dsb_prev_ins_is_write() Ville Syrjala
2026-11-17 15:44   ` Jani Nikula
2026-11-16  8:10 ` [PATCH 3/7] drm/i915/dsb: Carve up intel_dsb_prev_ins_is_indexed_write() Ville Syrjala
2026-11-17 15:47   ` Jani Nikula
2026-11-16  8:10 ` [PATCH 4/7] drm/i915/dsb: Extract intel_dsb_set_ins() Ville Syrjala
2026-11-17 15:48   ` Jani Nikula
2026-11-16  8:10 ` [PATCH 5/7] drm/i915/dsb: Update previous instruction tracking in intel_dsb_align_tail() & co Ville Syrjala
2026-11-17 16:07   ` Jani Nikula
2026-11-17 18:41     ` Ville Syrjälä
2026-11-17 18:55       ` Ville Syrjälä [this message]
2026-11-16  8:10 ` [PATCH 6/7] drm/i915/dsb: Skip redundant zeroing of every second indexed write DW Ville Syrjala
2026-11-17 15:57   ` Jani Nikula
2026-11-16  8:10 ` [PATCH 7/7] drm/i915/dsb: Avoid redundant writes to the DSB buffer for indexed register writes Ville Syrjala
2026-11-17 16:05   ` Jani Nikula
2026-11-17 18:46     ` Ville Syrjälä
2026-11-16  8:47 ` ✓ CI.KUnit: success for drm/i915/dsb: Optimize " Patchwork
2026-11-16  9:19 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-16 12:32 ` ✓ Xe.CI.FULL: " 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=avyjH8wbhxceMqop@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox