[PATCH 01/11] drm/i915/dsb: Extract intel_dsb_ins_align()

Borah, Chaitanya Kumar chaitanya.kumar.borah at intel.com
Wed May 14 11:58:16 UTC 2025



> -----Original Message-----
> From: Jani Nikula <jani.nikula at linux.intel.com>
> Sent: Wednesday, May 14, 2025 4:47 PM
> To: Borah, Chaitanya Kumar <chaitanya.kumar.borah at intel.com>; intel-
> xe at lists.freedesktop.org; intel-gfx at lists.freedesktop.org
> Cc: ville.syrjala at linux.intel.com; Shankar, Uma <uma.shankar at intel.com>;
> Borah, Chaitanya Kumar <chaitanya.kumar.borah at intel.com>; Manna,
> Animesh <animesh.manna at intel.com>
> Subject: Re: [PATCH 01/11] drm/i915/dsb: Extract intel_dsb_ins_align()
> 
> On Mon, 07 Apr 2025, Chaitanya Kumar Borah
> <chaitanya.kumar.borah at intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Extract the code that alings the next instruction to the next QW
> > boundary into a small helper. I'll have some more uses for this later.
> >
> > Also explain why we don't have to zero out the extra DW.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Chaitanya, your Signed-off-by is *required* in addition.
> 
> See https://developercertificate.org/.
> 

Thank you, Jani, for pointing it out. Pardon my ignorance. I will add it in the next version.

Regards

Chaitanya

> BR,
> Jani.
> 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dsb.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c
> > b/drivers/gpu/drm/i915/display/intel_dsb.c
> > index 0ddcdedf5453..c166e02b8af0 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> > @@ -228,13 +228,25 @@ static bool is_dsb_busy(struct intel_display
> *display, enum pipe pipe,
> >  	return intel_de_read_fw(display, DSB_CTRL(pipe, dsb_id)) &
> > DSB_STATUS_BUSY;  }
> >
> > +static void intel_dsb_ins_align(struct intel_dsb *dsb) {
> > +	/*
> > +	 * Every instruction should be 8 byte aligned.
> > +	 *
> > +	 * The only way to get unaligned free_pos is via
> > +	 * intel_dsb_reg_write_indexed() which already
> > +	 * makes sure the next dword is zeroed, so no need
> > +	 * to clear it here.
> > +	 */
> > +	dsb->free_pos = ALIGN(dsb->free_pos, 2); }
> > +
> >  static void intel_dsb_emit(struct intel_dsb *dsb, u32 ldw, u32 udw)
> > {
> >  	if (!assert_dsb_has_room(dsb))
> >  		return;
> >
> > -	/* Every instruction should be 8 byte aligned. */
> > -	dsb->free_pos = ALIGN(dsb->free_pos, 2);
> > +	intel_dsb_ins_align(dsb);
> >
> >  	dsb->ins_start_offset = dsb->free_pos;
> >  	dsb->ins[0] = ldw;
> 
> --
> Jani Nikula, Intel


More information about the Intel-gfx mailing list