]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu/ttm: Pin 4K MMIO_REMAP Singleton BO at Init v2
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Mon, 6 Oct 2025 14:16:53 +0000 (19:46 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:34 +0000 (13:56 -0500)
commitde8955508b72f8a88afc3f2cbb62334d5f79ccc3
tree090f21626f93b7a3bae89028a1ded67719540be9
parent54c2d9739bb748d0f7d6aaa101562cfa5963551d
drm/amdgpu/ttm: Pin 4K MMIO_REMAP Singleton BO at Init v2

MMIO_REMAP (HDP flush page) is a hardware I/O window exposed via a PCI
BAR.  It must not migrate or be evicted.

Allocate a single 4 KB GEM BO in AMDGPU_GEM_DOMAIN_MMIO_REMAP during TTM
initialization when the hardware exposes a remap bus address and the
host page size is <= 4 KiB. Reserve the BO and pin it at the TTM level
so it remains fixed for its lifetime. No CPU mapping is established
here.

On teardown, reserve, unpin, and free the BO if present.

This prepares the object to be shared (e.g., via dma-buf) without
triggering placement changes or no CPU-access migration

v2: Added extra NULL checks

Suggested-by: Christian König <christian.koenig@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c