aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-06-27 03:35:54 -0400
committerDave Airlie <airlied@redhat.com>2012-07-19 22:30:32 -0400
commit197bbb3d464f33eac1b458e83c1929d2f268d4c9 (patch)
treefdbbe5d8515307772fbce4ef30ff1d55300d8275 /drivers/gpu/drm/radeon/r600.c
parentf42977841f4a28b82820384fdb9b9581b410dbb1 (diff)
drm/radeon/kms: auto detect pcie link speed from root port
This check the root ports supported link speeds and enables GEN2 mode if the 5.0 GT link speed is available. The first 3.0 cards are SI so they will probably need more investigation. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index e2dee80e27dc..637280f541a3 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3681,6 +3681,8 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
3681{ 3681{
3682 u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp; 3682 u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp;
3683 u16 link_cntl2; 3683 u16 link_cntl2;
3684 u32 mask;
3685 int ret;
3684 3686
3685 if (radeon_pcie_gen2 == 0) 3687 if (radeon_pcie_gen2 == 0)
3686 return; 3688 return;
@@ -3699,6 +3701,15 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
3699 if (rdev->family <= CHIP_R600) 3701 if (rdev->family <= CHIP_R600)
3700 return; 3702 return;
3701 3703
3704 ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask);
3705 if (ret != 0)
3706 return;
3707
3708 if (!(mask & DRM_PCIE_SPEED_50))
3709 return;
3710
3711 DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n");
3712
3702 /* 55 nm r6xx asics */ 3713 /* 55 nm r6xx asics */
3703 if ((rdev->family == CHIP_RV670) || 3714 if ((rdev->family == CHIP_RV670) ||
3704 (rdev->family == CHIP_RV620) || 3715 (rdev->family == CHIP_RV620) ||