drm/amdgpu: Add EXT_COHERENT support for APU and NUMA systems
authorDavid Francis <David.Francis@amd.com>
Thu, 12 Oct 2023 14:35:20 +0000 (10:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Oct 2023 18:15:16 +0000 (14:15 -0400)
commit142262a1c02ad4d334ca1152dc4a0f6db3ef3bfc
treec999569dfc17380436eab0628c41b8aa4590281e
parenta395f7ffcebe59477d80f049889cb652d80db040
drm/amdgpu: Add EXT_COHERENT support for APU and NUMA systems

On gfx943 APU, EXT_COHERENT should give MTYPE_CC for local and
MTYPE_UC for nonlocal memory.

On NUMA systems, local memory gets the local mtype, set by an
override callback. If EXT_COHERENT is set, memory will be set as
MTYPE_UC by default, with local memory MTYPE_CC.

Add an option in the override function for this case, and
add a check to ensure it is not used on UNCACHED memory.

V2: Combined APU and NUMA code into one patch
V3: Fixed a potential nullptr in amdgpu_vm_bo_update

Signed-off-by: David Francis <David.Francis@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_vm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c