summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-05-15 17:25:03 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:26 -0400
commit61fb192a1cf87413e19f565495595c8c116d7c10 (patch)
tree7109a80a41a5e986964aefc4446212d65b183ad0 /drivers/gpu/drm/radeon/r600_dpm.c
parentc4453e66130119d9f2947ee051d598aae6823d49 (diff)
downloadlinux-stable-61fb192a1cf87413e19f565495595c8c116d7c10.tar.gz
linux-stable-61fb192a1cf87413e19f565495595c8c116d7c10.tar.bz2
linux-stable-61fb192a1cf87413e19f565495595c8c116d7c10.zip
drm/radeon/dpm: add a helper to encode pcie lane setting
convert from number of lanes to register setting. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_dpm.c')
-rw-r--r--drivers/gpu/drm/radeon/r600_dpm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
index 34ea5d6ee4be..89c46c55f93d 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.c
+++ b/drivers/gpu/drm/radeon/r600_dpm.c
@@ -1246,3 +1246,13 @@ u16 r600_get_pcie_lane_support(struct radeon_device *rdev,
return 16;
}
}
+
+u8 r600_encode_pci_lane_width(u32 lanes)
+{
+ u8 encoded_lanes[] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6 };
+
+ if (lanes > 16)
+ return 0;
+
+ return encoded_lanes[lanes];
+}