]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amdgpu: Add userptr bo support for mGPUs when iommu is on
authorShane Xiao <shane.xiao@amd.com>
Wed, 5 Apr 2023 14:33:11 +0000 (22:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Apr 2023 22:03:44 +0000 (18:03 -0400)
commit207bbfb63dc0eb491f71e96baa5db9c25626a247
tree1e7cbc9facfbd0823450d0ab7c0bd3627c4011a7
parent11f25c844e29f85abb0b3ffdb360a2f82a2c4ed0
drm/amdgpu: Add userptr bo support for mGPUs when iommu is on

For userptr bo with iommu on, multiple GPUs use same system
memory dma mapping address when both adev and bo_adev are in
identity mode or in the same iommu group.

If RAM direct map to one GPU, other GPUs can share the original
BO in order to reduce dma address array usage when RAM can
direct map to these GPUs. However, we should explicit check
whether RAM can direct map to all these GPUs.

This patch fixes a potential issue that where RAM is
direct mapped on some but not all GPUs.

v2:
  1. Update comment
  2. Add helper function reuse_dmamap

Signed-off-by: Shane Xiao <shane.xiao@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c