]> www.infradead.org Git - users/hch/misc.git/commit
drm/amdgpu/sdma_v4_4_2: update VM flush implementation for SDMA
authorJesse.zhang@amd.com <Jesse.zhang@amd.com>
Thu, 27 Feb 2025 11:33:19 +0000 (19:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Mar 2025 16:16:35 +0000 (12:16 -0400)
commit6ec04e38b2f640c12030a8af4b8fd5401f7e2235
tree4e43c75ca3df9eadb1b7fa1f6186e5ca45f5819d
parentb09cdeb4d38872b84c6d59878915eae2adbe9d2b
drm/amdgpu/sdma_v4_4_2: update VM flush implementation for SDMA

This commit updates the VM flush implementation for the SDMA engine.

- Added a new function `sdma_v4_4_2_get_invalidate_req` to construct the VM_INVALIDATE_ENG0_REQ
  register value for the specified VMID and flush type. This function ensures that all relevant
  page table cache levels (L1 PTEs, L2 PTEs, and L2 PDEs) are invalidated.

- Modified the `sdma_v4_4_2_ring_emit_vm_flush` function to use the new `sdma_v4_4_2_get_invalidate_req`
  function. The updated function emits the necessary register writes and waits to perform a VM flush
  for the specified VMID. It updates the PTB address registers and issues a VM invalidation request
  using the specified VM invalidation engine.

- Included the necessary header file `gc/gc_9_0_sh_mask.h` to provide access to the required register
  definitions.

v2: vm flush by the vm inalidation packet (Lijo)
v3: code stle and define thh macro for the vm invalidation packet (Christian)
v4: Format definition sdma vm invalidate packet (Lijo)

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
drivers/gpu/drm/amd/amdgpu/vega10_sdma_pkt_open.h