drm/amdgpu: set gfx9 onwards APU atomics support to be true
authorjsg <jsg@openbsd.org>
Mon, 19 Jun 2023 00:34:28 +0000 (00:34 +0000)
committerjsg <jsg@openbsd.org>
Mon, 19 Jun 2023 00:34:28 +0000 (00:34 +0000)
From Yifan Zhang
3e336ad6f517d1078b1e6e874e1578827088f269 in linux-6.1.y/6.1.33
af7828fbceed4f9e503034111066a0adef3db383 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c

index b892676..f4581db 100644 (file)
@@ -3773,6 +3773,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,
@@ -3781,7 +3787,14 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        if (!adev->have_atomics_support)
                dev_info(adev->dev, "PCIE atomic ops is not supported\n");
 #else
-       adev->have_atomics_support = false;
+       /* 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.
+        */
+       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 = false;
 #endif
 
        /* doorbell bar mapping and doorbell index init*/