[PATCH v3 7/9] drm/amdgpu/ttm: Initialize AMDGPU_PL_MMIO_REMAP Heap
Alex Deucher
alexdeucher at gmail.com
Thu Aug 28 15:31:25 UTC 2025
On Thu, Aug 28, 2025 at 5:53 AM Srinivasan Shanmugam
<srinivasan.shanmugam at amd.com> wrote:
>
> Add a one-page TTM range manager for AMDGPU_PL_MMIO_REMAP via
> amdgpu_ttm_init_on_chip(). This only registers the placement with TTM;
> no BO is allocated in this patch.
>
> The singleton 4K remap BO is created and freed in the following patch.
>
> This split follows to separate heap bring-up from BO allocation.
>
> Cc: Christian König <christian.koenig at amd.com>
> Suggested-by: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 9211d250fcfb..7822d8969c9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2020,6 +2020,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
> return r;
> }
>
> + /* Initialize MMIO-remap pool (single page 4K) */
> + r = amdgpu_ttm_init_on_chip(adev, AMDGPU_PL_MMIO_REMAP, 1);
> + if (r) {
> + dev_err(adev->dev, "Failed initializing MMIO-remap heap.\n");
> + return r;
> + }
> +
> /* Initialize preemptible memory pool */
> r = amdgpu_preempt_mgr_init(adev);
> if (r) {
> @@ -2082,6 +2089,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
> }
> amdgpu_bo_free_kernel(&adev->mman.sdma_access_bo, NULL,
> &adev->mman.sdma_access_ptr);
> +
> amdgpu_ttm_fw_reserve_vram_fini(adev);
> amdgpu_ttm_drv_reserve_vram_fini(adev);
>
> @@ -2103,6 +2111,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
> ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GWS);
> ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_OA);
> ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_DOORBELL);
> + ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_MMIO_REMAP);
> ttm_device_fini(&adev->mman.bdev);
> adev->mman.initialized = false;
> dev_info(adev->dev, "amdgpu: ttm finalized\n");
> --
> 2.34.1
>
More information about the amd-gfx
mailing list