Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17
+14
drivers/gpu/drm/radeon/sumo_dpm.c
··· 1530 1530 return vid_mapping_table->entries[vid_mapping_table->num_entries - 1].vid_7bit; 1531 1531 } 1532 1532 1533 + u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev, 1534 + struct sumo_vid_mapping_table *vid_mapping_table, 1535 + u32 vid_7bit) 1536 + { 1537 + u32 i; 1538 + 1539 + for (i = 0; i < vid_mapping_table->num_entries; i++) { 1540 + if (vid_mapping_table->entries[i].vid_7bit == vid_7bit) 1541 + return vid_mapping_table->entries[i].vid_2bit; 1542 + } 1543 + 1544 + return vid_mapping_table->entries[vid_mapping_table->num_entries - 1].vid_2bit; 1545 + } 1546 + 1533 1547 static u16 sumo_convert_voltage_index_to_value(struct radeon_device *rdev, 1534 1548 u32 vid_2bit) 1535 1549 {
+3
drivers/gpu/drm/radeon/sumo_dpm.h
··· 202 202 u32 sumo_convert_vid2_to_vid7(struct radeon_device *rdev, 203 203 struct sumo_vid_mapping_table *vid_mapping_table, 204 204 u32 vid_2bit); 205 + u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev, 206 + struct sumo_vid_mapping_table *vid_mapping_table, 207 + u32 vid_7bit); 205 208 u32 sumo_get_sleep_divider_from_id(u32 id); 206 209 u32 sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev, 207 210 u32 sclk,