aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-06-25 14:07:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-07-05 17:39:59 -0400
commit5d9a6330403271fbb1244f14380a7cc44662796f (patch)
tree16b64e29d9b788acfe9577d3e7fa012ab3a0d7ae /drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
parent4976f1c8ccff0d682176851692976e3bf03267d6 (diff)
drm/amdgpu: use pcie functions for link width and speed
Use the newly exported pci functions to get the link width and speed rather than using the drm duplicated versions. Also query the GPU link caps directly rather than hardcoding them. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
index 77ad59ade85c..1c4595562f8f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
@@ -28,6 +28,7 @@
28#include "amdgpu_i2c.h" 28#include "amdgpu_i2c.h"
29#include "amdgpu_dpm.h" 29#include "amdgpu_dpm.h"
30#include "atom.h" 30#include "atom.h"
31#include "amd_pcie.h"
31 32
32void amdgpu_dpm_print_class_info(u32 class, u32 class2) 33void amdgpu_dpm_print_class_info(u32 class, u32 class2)
33{ 34{
@@ -936,9 +937,11 @@ enum amdgpu_pcie_gen amdgpu_get_pcie_gen_support(struct amdgpu_device *adev,
936 case AMDGPU_PCIE_GEN3: 937 case AMDGPU_PCIE_GEN3:
937 return AMDGPU_PCIE_GEN3; 938 return AMDGPU_PCIE_GEN3;
938 default: 939 default:
939 if ((sys_mask & DRM_PCIE_SPEED_80) && (default_gen == AMDGPU_PCIE_GEN3)) 940 if ((sys_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3) &&
941 (default_gen == AMDGPU_PCIE_GEN3))
940 return AMDGPU_PCIE_GEN3; 942 return AMDGPU_PCIE_GEN3;
941 else if ((sys_mask & DRM_PCIE_SPEED_50) && (default_gen == AMDGPU_PCIE_GEN2)) 943 else if ((sys_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2) &&
944 (default_gen == AMDGPU_PCIE_GEN2))
942 return AMDGPU_PCIE_GEN2; 945 return AMDGPU_PCIE_GEN2;
943 else 946 else
944 return AMDGPU_PCIE_GEN1; 947 return AMDGPU_PCIE_GEN1;