diff options
author | Alex Deucher | 2013-05-14 17:44:31 -0400 |
---|---|---|
committer | Alex Deucher | 2013-08-30 16:30:25 -0400 |
commit | 4df5ac2652d1ab9c15b7b11dbbd285157bcb5ee5 (patch) | |
tree | 068e552908c2fb107cffbb014da9306f1cd3e186 | |
parent | 96d2af2150c1e3326ea1163db1210ba4139f190a (diff) |
drm/radeon: add r600_get_pcie_lane_support helper
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/r600_dpm.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_dpm.h | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index bf851ac5491a..34ea5d6ee4be 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -1223,3 +1223,26 @@ enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev, } return RADEON_PCIE_GEN1; } + +u16 r600_get_pcie_lane_support(struct radeon_device *rdev, + u16 asic_lanes, + u16 default_lanes) +{ + switch (asic_lanes) { + case 0: + default: + return default_lanes; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 12: + return 12; + case 16: + return 16; + } +} diff --git a/drivers/gpu/drm/radeon/r600_dpm.h b/drivers/gpu/drm/radeon/r600_dpm.h index 7c822d9ae53d..71d5d93c371b 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.h +++ b/drivers/gpu/drm/radeon/r600_dpm.h @@ -224,4 +224,8 @@ enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev, enum radeon_pcie_gen asic_gen, enum radeon_pcie_gen default_gen); +u16 r600_get_pcie_lane_support(struct radeon_device *rdev, + u16 asic_lanes, + u16 default_lanes); + #endif |