summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/sumo_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-04-19 13:29:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:10 -0400
commit03243fc6568b3fa02de8de05daa02f021f16c3e4 (patch)
tree98bb8381a9d8b6975f090d95c2d0a9bc70c30a70 /drivers/gpu/drm/radeon/sumo_dpm.c
parent1d58234d5e0a2475f1be78d1c05146a3af4f875d (diff)
downloadblackbird-op-linux-03243fc6568b3fa02de8de05daa02f021f16c3e4.tar.gz
blackbird-op-linux-03243fc6568b3fa02de8de05daa02f021f16c3e4.zip
drm/radeon/sumo add helper to go from vid7 to vid2
Needed for DPM on KB/KV. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/sumo_dpm.c')
-rw-r--r--drivers/gpu/drm/radeon/sumo_dpm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index c0a850319908..2cefe59ef586 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1530,6 +1530,20 @@ u32 sumo_convert_vid2_to_vid7(struct radeon_device *rdev,
return vid_mapping_table->entries[vid_mapping_table->num_entries - 1].vid_7bit;
}
+u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev,
+ struct sumo_vid_mapping_table *vid_mapping_table,
+ u32 vid_7bit)
+{
+ u32 i;
+
+ for (i = 0; i < vid_mapping_table->num_entries; i++) {
+ if (vid_mapping_table->entries[i].vid_7bit == vid_7bit)
+ return vid_mapping_table->entries[i].vid_2bit;
+ }
+
+ return vid_mapping_table->entries[vid_mapping_table->num_entries - 1].vid_2bit;
+}
+
static u16 sumo_convert_voltage_index_to_value(struct radeon_device *rdev,
u32 vid_2bit)
{
OpenPOWER on IntegriCloud