[RFC PATCH v2 0/8] drm/amdgpu: Add MMIO-remap Singleton BO for HDP flush
Srinivasan Shanmugam
srinivasan.shanmugam at amd.com
Sat Aug 23 07:20:08 UTC 2025
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.
v2: Updated review comments from v1. (Alex/Christian)
* Only compilation tested so far (x86_64, defconfig + amdgpu enabled).
Cc: Christian König <christian.koenig at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Srinivasan Shanmugam (8):
drm/amdgpu/uapi: Introduce AMDGPU_GEM_DOMAIN_MMIO_REMAP
drm/amdgpu/ttm: Add New AMDGPU_PL_MMIO_REMAP Placement
drm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings
drm/amdgpu: Add mmio_remap bookkeeping to amdgpu_device
drm/amdgpu: Implement TTM handling for MMIO_REMAP placement
drm/amdgpu/ttm: Initialize AMDGPU_PL_MMIO_REMAP Heap
drm/amdgpu/ttm: Allocate/Free 4K MMIO_REMAP Singleton BO
drm/amdgpu/gem: Return Handle to MMIO_REMAP Singleton in GEM_CREATE
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 62 ++++++++++++
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 | 96 ++++++++++++++++++-
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, 183 insertions(+), 7 deletions(-)
base-commit: 6b70b6008d812a9a210455dd55459a21279bad1e
--
2.34.1
More information about the amd-gfx
mailing list