drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs
authorYong Zhao <Yong.Zhao@amd.com>
Thu, 13 Sep 2018 01:42:20 +0000 (21:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:18:17 +0000 (09:18 +0200)
commit3792c002b9ff85cd8551f36a8886d9ca0e3bcf8f
tree55fa8fb68dd755656564c7cf2fcd51f47ed351b9
parentc2fd5b21cbd9fc777fde1509a3e709450094b1ba
drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs

[ Upstream commit 44d8cc6f1a905e4bb1d4221a898abb0d7e9d100a ]

Because CRAT_CU_FLAGS_IOMMU_PRESENT was not set in some BIOS crat, we
need to workaround this.

For future compatibility, we also overwrite the bit in capability according
to the value of needs_iommu_device.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_iommu.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_topology.c