amd/amdgpu: Inherit coherence flags base on original BO flags
authorShane Xiao <shane.xiao@amd.com>
Thu, 6 Apr 2023 04:37:16 +0000 (12:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Apr 2023 22:03:44 +0000 (18:03 -0400)
commitaf152c2120587b02e03dfe370b52ba75c40f8952
tree08ffd5d0e4b43febfe6b469388f3147533796efb
parent89317d4255122f05aaa0ac16d189a9ab3022653c
amd/amdgpu: Inherit coherence flags base on original BO flags

For SG BO to DMA-map userptrs on other GPUs, the SG BO
need inherit MTYPEs in PTEs from original BO.

If we set the flags, the device can be coherent with
the CPUs and other GPUs.

v2:
  1. Drop unnecessary flags check
  2. Remove local variable align

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