drm/amdgpu: set gfx9 onwards APU atomics support to be true
authorYifan Zhang <yifan1.zhang@amd.com>
Thu, 27 Apr 2023 06:01:05 +0000 (14:01 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 11 May 2023 05:04:50 +0000 (01:04 -0400)
APUs w/ gfx9 onwards doesn't reply on PCIe atomics, rather
it is internal path w/ native atomic support. Set have_atomics_support
to true.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Lang Yu <lang.yu@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 981a9cfb63b5779f0ef51d56523335d188993c0f..e348a62ec0ec689e08cb86009d7e18850283d34d 100644 (file)
@@ -3757,6 +3757,12 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                adev->have_atomics_support = ((struct amd_sriov_msg_pf2vf_info *)
                        adev->virt.fw_reserve.p_pf2vf)->pcie_atomic_ops_support_flags ==
                        (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64);
+       /* APUs w/ gfx9 onwards doesn't reply on PCIe atomics, rather it is a
+        * internal path natively support atomics, set have_atomics_support to true.
+        */
+       else if ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0)))
+               adev->have_atomics_support = true;
        else
                adev->have_atomics_support =
                        !pci_enable_atomic_ops_to_root(adev->pdev,