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) v3: Updated review comments from v2. (Alex/Christian) [RFC,v2,1/8] drm/amdgpu/uapi: Introduce AMDGPU_GEM_DOMAIN_MMIO_REMAP | https://patchwork.freedesktop.org/patch/670410/ [RFC,v2,2/8] drm/amdgpu/ttm: Add New AMDGPU_PL_MMIO_REMAP Placement | https://patchwork.freedesktop.org/patch/670411/ [RFC,v2,3/8] drm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings | https://patchwork.freedesktop.org/patch/670412/ [RFC,v2,4/8] drm/amdgpu: Add mmio_remap bookkeeping to amdgpu_device | https://patchwork.freedesktop.org/patch/670415/ [RFC,v2,5/8] drm/amdgpu: Implement TTM handling for MMIO_REMAP placement | https://patchwork.freedesktop.org/patch/670413/ [RFC,v2,6/8] drm/amdgpu/ttm: Initialize AMDGPU_PL_MMIO_REMAP Heap | https://patchwork.freedesktop.org/patch/670414/ [RFC,v2,7/8] drm/amdgpu/ttm: Allocate/Free 4K MMIO_REMAP Singleton BO | https://patchwork.freedesktop.org/patch/670417/ [RFC,v2,8/8] drm/amdgpu/gem: Return Handle to MMIO_REMAP Singleton in GEM_CREATE | https://patchwork.freedesktop.org/patch/670416/ * Only compilation tested so far (x86_64, defconfig + amdgpu enabled). Cc: Christian König <christian.koe...@amd.com> Cc: Alex Deucher <alexander.deuc...@amd.com> Srinivasan Shanmugam (9): drm/amdgpu/uapi: Introduce AMDGPU_GEM_DOMAIN_MMIO_REMAP drm/ttm: Bump TTM_NUM_MEM_TYPES to 9 (Prep for AMDGPU_PL_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 | 87 ++++++++++++++++++- 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, 174 insertions(+), 7 deletions(-) base-commit: 6b70b6008d812a9a210455dd55459a21279bad1e -- 2.34.1