]> Gentwo Git Trees - linux/.git/commit
drm/amdgpu: Implement TTM handling for MMIO_REMAP placement
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 20 Aug 2025 10:51:16 +0000 (16:21 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Sep 2025 20:51:59 +0000 (16:51 -0400)
commitfb5a52dbe9fecde432b4da7ea2d2724a947e9a79
tree49d892aace3a3b83bcb4eb685de0b0f409608cd9
parent99eeb8358e6cdb7050bf2956370c15dcceda8c7e
drm/amdgpu: Implement TTM handling for MMIO_REMAP placement

Implement TTM-level behavior for AMDGPU_PL_MMIO_REMAP so it behaves as a
CPU-visible IO page:

* amdgpu_evict_flags(): mark as unmovable
* amdgpu_res_cpu_visible(): consider CPU-visible
* amdgpu_bo_move(): use null move when src/dst is MMIO_REMAP
* amdgpu_ttm_io_mem_reserve(): program base/is_iomem/caching using
  the device's mmio_remap_* metadata
* amdgpu_ttm_io_mem_pfn(): return PFN for the remapped HDP page
* amdgpu_ttm_tt_pde_flags(): set AMDGPU_PTE_SYSTEM for this mem type

v2:
- Drop HDP-specific comment; keep generic remap (Alex).

v3:
- Fix indentation in amdgpu_res_cpu_visible (Christian).
- Use adev->rmmio_remap.bus_addr for MMIO_REMAP bus/PFN calculations
  (Alex).

v4:
- Drop unnecessary (resource_size_t) casts in MMIO_REMAP io-mem paths
  (Alex)

Cc: 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: Alex Deucher <alexander.deucher@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