Commit 901e2be2 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: move PX checking into amdgpu_device_ip_early_init

We need to set the APU flag from IP discovery before
we evaluate this code.
Acked-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 21202129
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/iommu.h> #include <linux/iommu.h>
#include <linux/pci.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
...@@ -2073,6 +2074,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) ...@@ -2073,6 +2074,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
*/ */
static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
{ {
struct drm_device *dev = adev_to_drm(adev);
struct pci_dev *parent;
int i, r; int i, r;
amdgpu_device_enable_virtual_display(adev); amdgpu_device_enable_virtual_display(adev);
...@@ -2137,6 +2140,16 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) ...@@ -2137,6 +2140,16 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
break; break;
} }
if (amdgpu_has_atpx() &&
(amdgpu_is_atpx_hybrid() ||
amdgpu_has_atpx_dgpu_power_cntl()) &&
((adev->flags & AMD_IS_APU) == 0) &&
!pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
adev->flags |= AMD_IS_PX;
parent = pci_upstream_bridge(adev->pdev);
adev->has_pr3 = parent ? pci_pr3_present(parent) : false;
amdgpu_amdkfd_device_probe(adev); amdgpu_amdkfd_device_probe(adev);
adev->pm.pp_feature = amdgpu_pp_feature_mask; adev->pm.pp_feature = amdgpu_pp_feature_mask;
......
...@@ -152,21 +152,10 @@ static void amdgpu_get_audio_func(struct amdgpu_device *adev) ...@@ -152,21 +152,10 @@ static void amdgpu_get_audio_func(struct amdgpu_device *adev)
int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
{ {
struct drm_device *dev; struct drm_device *dev;
struct pci_dev *parent;
int r, acpi_status; int r, acpi_status;
dev = adev_to_drm(adev); dev = adev_to_drm(adev);
if (amdgpu_has_atpx() &&
(amdgpu_is_atpx_hybrid() ||
amdgpu_has_atpx_dgpu_power_cntl()) &&
((flags & AMD_IS_APU) == 0) &&
!pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
flags |= AMD_IS_PX;
parent = pci_upstream_bridge(adev->pdev);
adev->has_pr3 = parent ? pci_pr3_present(parent) : false;
/* amdgpu_device_init should report only fatal error /* amdgpu_device_init should report only fatal error
* like memory allocation failure or iomapping failure, * like memory allocation failure or iomapping failure,
* or memory manager initialization failure, it must * or memory manager initialization failure, it must
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment