[PATCH 10/19] drm/amdgpu: pad ring in amdgpu_ib_schedule

Alex Deucher alexdeucher at gmail.com
Wed May 28 13:49:27 UTC 2025


On Wed, May 28, 2025 at 9:42 AM Christian König
<christian.koenig at amd.com> wrote:
>
> On 5/28/25 15:41, Alex Deucher wrote:
> > On Wed, May 28, 2025 at 7:45 AM Christian König
> > <christian.koenig at amd.com> wrote:
> >>
> >> On 5/28/25 06:19, Alex Deucher wrote:
> >>> We'll want to include the padding in the wptr count
> >>> for resets.
> >>>
> >>> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> >>> ---
> >>>  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++
> >>>  1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> >>> index 802743efa3b39..3e05e8bfaca4a 100644
> >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> >>> @@ -304,6 +304,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
> >>>           ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
> >>>               ring->funcs->emit_wave_limit(ring, false);
> >>>
> >>> +     amdgpu_ring_pad_to_fetch_size(ring);
> >>> +
> >>
> >> Hui? Why that here? amdgpu_ring_commit will do that anyway.
> >
> > So that I can know the full size of the submission frame for this job
> > when I grab the follow-on ring contents to re-emit.  See the next
> > patch.
>
> Ah! Ok, why not doing that after the ring_commit? Then we don't need to change anything here.

Oh, yeah, that should work.

Alex


>
> Christian.
>
> >
> > Alex
> >
> >>
> >>
> >>>       amdgpu_ring_ib_end(ring);
> >>>       amdgpu_ring_commit(ring);
> >>>       return 0;
> >>
>


More information about the amd-gfx mailing list