Commit 47240ed1 authored by Alex Deucher's avatar Alex Deucher Committed by Tim Gardner

drm/amdgpu/dpm/ci: switch over to the common pcie caps interface

BugLink: http://bugs.launchpad.net/bugs/1546572

We already query this at driver init, so use that info.  Also
handles virtualization cases.
Reviewed-by: default avatarmonk liu <monk.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 50171ebe)
Signed-off-by: default avatarAlberto Milone <alberto.milone@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 7ea0451c
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "ci_dpm.h" #include "ci_dpm.h"
#include "gfx_v7_0.h" #include "gfx_v7_0.h"
#include "atom.h" #include "atom.h"
#include "amd_pcie.h"
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include "smu/smu_7_0_1_d.h" #include "smu/smu_7_0_1_d.h"
...@@ -5835,18 +5836,16 @@ static int ci_dpm_init(struct amdgpu_device *adev) ...@@ -5835,18 +5836,16 @@ static int ci_dpm_init(struct amdgpu_device *adev)
u8 frev, crev; u8 frev, crev;
struct ci_power_info *pi; struct ci_power_info *pi;
int ret; int ret;
u32 mask;
pi = kzalloc(sizeof(struct ci_power_info), GFP_KERNEL); pi = kzalloc(sizeof(struct ci_power_info), GFP_KERNEL);
if (pi == NULL) if (pi == NULL)
return -ENOMEM; return -ENOMEM;
adev->pm.dpm.priv = pi; adev->pm.dpm.priv = pi;
ret = drm_pcie_get_speed_cap_mask(adev->ddev, &mask); pi->sys_pcie_mask =
if (ret) (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_MASK) >>
pi->sys_pcie_mask = 0; CAIL_PCIE_LINK_SPEED_SUPPORT_SHIFT;
else
pi->sys_pcie_mask = mask;
pi->force_pcie_gen = AMDGPU_PCIE_GEN_INVALID; pi->force_pcie_gen = AMDGPU_PCIE_GEN_INVALID;
pi->pcie_gen_performance.max = AMDGPU_PCIE_GEN1; pi->pcie_gen_performance.max = AMDGPU_PCIE_GEN1;
......
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