From: jsg Date: Wed, 2 Mar 2022 12:53:45 +0000 (+0000) Subject: drm/amd: Check if ASPM is enabled from PCIe subsystem X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=adba1814597e6aba5fcfc5a6738cf0d0ed2d6b37;p=openbsd drm/amd: Check if ASPM is enabled from PCIe subsystem From Mario Limonciello ea44fcee7e3d87725423c904306a99cd42bd24b7 in linux 5.15.y/5.15.26 7294863a6f01248d72b61d38478978d638641bee in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index 0914e142eb9..ce524e36159 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -1279,6 +1279,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, bool is_fw_fb; resource_size_t base, size; + if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev)) + amdgpu_aspm = 0; + if (amdgpu_virtual_display || amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK)) supports_atomic = true; diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c index 193f66774a3..e8cbeabd125 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c @@ -1855,7 +1855,7 @@ amdgpu_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - /* from amdgpu_pci_probe() */ + /* from amdgpu_pci_probe(), aspm test done later */ if (!amdgpu_virtual_display && amdgpu_device_asic_has_dc_support(adev->family)) @@ -1880,6 +1880,10 @@ amdgpu_attach(struct device *parent, struct device *self, void *aux) adev->pdev = dev->pdev; adev->is_fw_fb = adev->primary; + /* from amdgpu_pci_probe() */ + if (amdgpu_aspm == -1 && !pcie_aspm_enabled(adev->pdev)) + amdgpu_aspm = 0; + if (!supports_atomic) dev->driver_features &= ~DRIVER_ATOMIC;