[RFC PATCH 4/7] drm/amdgpu: Add mmio_remap fields to amdgpu_device

Deucher, Alexander Alexander.Deucher at amd.com
Wed Aug 20 21:49:31 UTC 2025


[Public]

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Deucher,
> Alexander
> Sent: Wednesday, August 20, 2025 5:08 PM
> To: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>;
> Koenig, Christian <Christian.Koenig at amd.com>
> Cc: amd-gfx at lists.freedesktop.org
> Subject: RE: [RFC PATCH 4/7] drm/amdgpu: Add mmio_remap fields to
> amdgpu_device
>
> [Public]
>
> > -----Original Message-----
> > From: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>
> > Sent: Wednesday, August 20, 2025 7:33 AM
> > To: Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander
> > <Alexander.Deucher at amd.com>
> > Cc: amd-gfx at lists.freedesktop.org; SHANMUGAM, SRINIVASAN
> > <SRINIVASAN.SHANMUGAM at amd.com>
> > Subject: [RFC PATCH 4/7] drm/amdgpu: Add mmio_remap fields to
> > amdgpu_device
> >
> > Add bookkeeping for the remap page to struct amdgpu_device:
> >
> > * mmio_remap_bo (singleton BO)
> > * mmio_remap_base, mmio_remap_barsz (register BAR base/size)
> > * mmio_remap_offset (BAR-relative offset of the remap page)
> > * mmio_remap_size (PAGE_SIZE)
> >
> > Cc: Christian König <christian.koenig at amd.com>
> > Cc: Alex Deucher <alexander.deucher at amd.com>
> > Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > index ddd472e56f69..6c477596617b 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > @@ -1038,6 +1038,13 @@ struct amdgpu_device {
> >       amdgpu_block_wreg_t             audio_endpt_wreg;
> >       struct amdgpu_doorbell          doorbell;
> >
> > +     /* ===== MMIO remap (HDP flush) bookkeeping ===== */
> > +     struct amdgpu_bo                *mmio_remap_bo;   /* singleton BO */
> > +     resource_size_t                  mmio_remap_base;  /* REG BAR bus base */
> > +     resource_size_t                  mmio_remap_barsz; /* REG BAR size */
> > +     resource_size_t                  mmio_remap_offset;/* BAR-relative offset of
> > remap page */
> > +     resource_size_t                  mmio_remap_size;  /* always PAGE_SIZE */
>
>
> Also maybe put these in their own struct, similar to what we do for doorbells and
> drop the mmio_remap prefix.  E.g.,
>
> struct amdgpu_mmio_remap.{
>     resource_size_t base;
>     resource_size_t size
>     struct amdgpu_bo;
> };
>

Actually we already have struct amdgpu_mmio_remap.  Just update that structure.

Alex


> Alex
>
> > +
> >       /* clock/pll info */
> >       struct amdgpu_clock            clock;
> >
> > --
> > 2.34.1



More information about the amd-gfx mailing list