[RFC PATCH 0/7] drm/amdgpu: add MMIO-remap singleton BO for HDP flush

Christian König christian.koenig at amd.com
Mon Aug 25 14:57:55 UTC 2025


On 20.08.25 13:32, Srinivasan Shanmugam wrote:
> This series introduces a kernel-managed singleton BO representing the
> MMIO-remap (HDP flush) page and exposes it to userspace through a new
> GEM domain.
> 
> Design ------
> - A tiny (1-page) TTM bucket is introduced for AMDGPU_PL_MMIO_REMAP
>   (mirroring doorbells).
> - A singleton BO is created during amdgpu_ttm_init() and freed at
>   fini().
> - The BO is kernel-owned and never evicted.
> - amdgpu_gem_create_ioctl() recognizes the new GEM domain bit
>   (AMDGPU_GEM_DOMAIN_MMIO_REMAP) and returns a handle to the pre-created
> singleton BO, enforcing size/alignment checks.
> - Userspace thus gets a stable GEM handle and can mmap it to issue HDP
>   flushes.
> 
> * Only compilation tested so far (x86_64, defconfig + amdgpu enabled).
> * No runtime validation yet.
> 
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>

Patch #1, #3 Reviewed-by: Christian König <christian.koenig at amd.com>

The rest needs some more work.

Regards,
Christian.

> Srinivasan Shanmugam (7):
>   drm/amdgpu/uapi: add AMDGPU_GEM_DOMAIN_MMIO_REMAP
>   drm/amdgpu: Add New TTM Placement - AMDGPU_PL_MMIO_REMAP and wire up
>     plumbing
>   drm/amdgpu: Plumbing for MMIO_REMAP memtype and user-visible strings
>   drm/amdgpu: Add mmio_remap fields to amdgpu_device
>   drm/amdgpu: Implement TTM handling for MMIO_REMAP placement
>   drm/amdgpu: Create Singleton MMIO_REMAP BO and Initialize its pool
>   drm/amdgpu: Return Handle to MMIO_REMAP Singleton for GEM Create
> 
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   7 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c    |   1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c       |  56 +++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c    |  13 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.h    |   2 +
>  .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h    |   2 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       | 112 +++++++++++++++++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h       |   3 +-
>  include/drm/ttm/ttm_resource.h                |   2 +-
>  include/uapi/drm/amdgpu_drm.h                 |   8 +-
>  10 files changed, 198 insertions(+), 8 deletions(-)
> 



More information about the amd-gfx mailing list