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

drm/amd/pp: Remove the same struct define in powerplay

delete the same struct define in powerplay, share the struct
with display.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rex Zhu and committed by
Alex Deucher
20582319 70b63170

+27 -60
+2 -35
drivers/gpu/drm/amd/include/dm_pp_interface.h
··· 23 23 #ifndef _DM_PP_INTERFACE_ 24 24 #define _DM_PP_INTERFACE_ 25 25 26 + #include "dm_services_types.h" 27 + 26 28 #define PP_MAX_CLOCK_LEVELS 16 27 29 28 30 enum amd_pp_display_config_type{ ··· 189 187 struct pp_display_clock_request { 190 188 enum amd_pp_clock_type clock_type; 191 189 uint32_t clock_freq_in_khz; 192 - }; 193 - 194 - #define PP_MAX_WM_SETS 4 195 - 196 - enum pp_wm_set_id { 197 - DC_WM_SET_A = 0, 198 - DC_WM_SET_B, 199 - DC_WM_SET_C, 200 - DC_WM_SET_D, 201 - DC_WM_SET_INVALID = 0xffff, 202 - }; 203 - 204 - struct pp_wm_set_with_dmif_clock_range_soc15 { 205 - enum pp_wm_set_id wm_set_id; 206 - uint32_t wm_min_dcefclk_in_khz; 207 - uint32_t wm_max_dcefclk_in_khz; 208 - uint32_t wm_min_memclk_in_khz; 209 - uint32_t wm_max_memclk_in_khz; 210 - }; 211 - 212 - struct pp_wm_set_with_mcif_clock_range_soc15 { 213 - enum pp_wm_set_id wm_set_id; 214 - uint32_t wm_min_socclk_in_khz; 215 - uint32_t wm_max_socclk_in_khz; 216 - uint32_t wm_min_memclk_in_khz; 217 - uint32_t wm_max_memclk_in_khz; 218 - }; 219 - 220 - struct pp_wm_sets_with_clock_ranges_soc15 { 221 - uint32_t num_wm_sets_dmif; 222 - uint32_t num_wm_sets_mcif; 223 - struct pp_wm_set_with_dmif_clock_range_soc15 224 - wm_sets_dmif[PP_MAX_WM_SETS]; 225 - struct pp_wm_set_with_mcif_clock_range_soc15 226 - wm_sets_mcif[PP_MAX_WM_SETS]; 227 190 }; 228 191 229 192 #endif /* _DM_PP_INTERFACE_ */
+1 -1
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
··· 1111 1111 void *clock_ranges) 1112 1112 { 1113 1113 struct smu10_hwmgr *data = hwmgr->backend; 1114 - struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_ranges; 1114 + struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_ranges; 1115 1115 Watermarks_t *table = &(data->water_marks_table); 1116 1116 int result = 0; 1117 1117
+21 -21
drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
··· 652 652 } 653 653 654 654 int smu_set_watermarks_for_clocks_ranges(void *wt_table, 655 - struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges) 655 + struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges) 656 656 { 657 657 uint32_t i; 658 658 struct watermarks *table = wt_table; ··· 660 660 if (!table || !wm_with_clock_ranges) 661 661 return -EINVAL; 662 662 663 - if (wm_with_clock_ranges->num_wm_sets_dmif > 4 || wm_with_clock_ranges->num_wm_sets_mcif > 4) 663 + if (wm_with_clock_ranges->num_wm_dmif_sets > 4 || wm_with_clock_ranges->num_wm_mcif_sets > 4) 664 664 return -EINVAL; 665 665 666 - for (i = 0; i < wm_with_clock_ranges->num_wm_sets_dmif; i++) { 666 + for (i = 0; i < wm_with_clock_ranges->num_wm_dmif_sets; i++) { 667 667 table->WatermarkRow[1][i].MinClock = 668 668 cpu_to_le16((uint16_t) 669 - (wm_with_clock_ranges->wm_sets_dmif[i].wm_min_dcefclk_in_khz) / 670 - 100); 669 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_dcfclk_clk_in_khz) / 670 + 1000); 671 671 table->WatermarkRow[1][i].MaxClock = 672 672 cpu_to_le16((uint16_t) 673 - (wm_with_clock_ranges->wm_sets_dmif[i].wm_max_dcefclk_in_khz) / 673 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_dcfclk_clk_in_khz) / 674 674 100); 675 675 table->WatermarkRow[1][i].MinUclk = 676 676 cpu_to_le16((uint16_t) 677 - (wm_with_clock_ranges->wm_sets_dmif[i].wm_min_memclk_in_khz) / 678 - 100); 677 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_mem_clk_in_khz) / 678 + 1000); 679 679 table->WatermarkRow[1][i].MaxUclk = 680 680 cpu_to_le16((uint16_t) 681 - (wm_with_clock_ranges->wm_sets_dmif[i].wm_max_memclk_in_khz) / 682 - 100); 681 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_mem_clk_in_khz) / 682 + 1000); 683 683 table->WatermarkRow[1][i].WmSetting = (uint8_t) 684 - wm_with_clock_ranges->wm_sets_dmif[i].wm_set_id; 684 + wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_set_id; 685 685 } 686 686 687 - for (i = 0; i < wm_with_clock_ranges->num_wm_sets_mcif; i++) { 687 + for (i = 0; i < wm_with_clock_ranges->num_wm_mcif_sets; i++) { 688 688 table->WatermarkRow[0][i].MinClock = 689 689 cpu_to_le16((uint16_t) 690 - (wm_with_clock_ranges->wm_sets_mcif[i].wm_min_socclk_in_khz) / 691 - 100); 690 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_socclk_clk_in_khz) / 691 + 1000); 692 692 table->WatermarkRow[0][i].MaxClock = 693 693 cpu_to_le16((uint16_t) 694 - (wm_with_clock_ranges->wm_sets_mcif[i].wm_max_socclk_in_khz) / 695 - 100); 694 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_socclk_clk_in_khz) / 695 + 1000); 696 696 table->WatermarkRow[0][i].MinUclk = 697 697 cpu_to_le16((uint16_t) 698 - (wm_with_clock_ranges->wm_sets_mcif[i].wm_min_memclk_in_khz) / 699 - 100); 698 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_mem_clk_in_khz) / 699 + 1000); 700 700 table->WatermarkRow[0][i].MaxUclk = 701 701 cpu_to_le16((uint16_t) 702 - (wm_with_clock_ranges->wm_sets_mcif[i].wm_max_memclk_in_khz) / 703 - 100); 702 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_mem_clk_in_khz) / 703 + 1000); 704 704 table->WatermarkRow[0][i].WmSetting = (uint8_t) 705 - wm_with_clock_ranges->wm_sets_mcif[i].wm_set_id; 705 + wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id; 706 706 } 707 707 return 0; 708 708 }
+1 -1
drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h
··· 107 107 struct phm_ppt_v1_clock_voltage_dependency_table *dep_table); 108 108 109 109 int smu_set_watermarks_for_clocks_ranges(void *wt_table, 110 - struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges); 110 + struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges); 111 111 112 112 #define PHM_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT 113 113 #define PHM_FIELD_MASK(reg, field) reg##__##field##_MASK
+1 -1
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
··· 4197 4197 void *clock_range) 4198 4198 { 4199 4199 struct vega10_hwmgr *data = hwmgr->backend; 4200 - struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_range; 4200 + struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_range; 4201 4201 Watermarks_t *table = &(data->smc_state_table.water_marks_table); 4202 4202 int result = 0; 4203 4203
+1 -1
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
··· 1785 1785 { 1786 1786 struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend); 1787 1787 Watermarks_t *table = &(data->smc_state_table.water_marks_table); 1788 - struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_ranges; 1788 + struct dm_pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges = clock_ranges; 1789 1789 1790 1790 if (!data->registry_data.disable_water_mark && 1791 1791 data->smu_features[GNLD_DPM_DCEFCLK].supported &&