aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-04-09 22:58:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 14:43:08 -0400
commit29ae1118d85e8435b12fca512410dbd39920cce9 (patch)
treeff6833d3450af420ec500e3e3eafa3434aa08fa9 /drivers/gpu
parent45313e5f1c72962a21df58af52a421e4c076b2d4 (diff)
drm/amd/pp: Remove unnecessary forward declaration
Reviewed-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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c84
1 files changed, 41 insertions, 43 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 26c56025d56c..127c550e8bb1 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -75,8 +75,6 @@ static const uint32_t channel_number[] = {1, 2, 0, 4, 0, 8, 0, 16, 2};
75#define DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK 0x000000F0L 75#define DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK 0x000000F0L
76#define DF_CS_AON0_DramBaseAddress0__IntLvAddrSel_MASK 0x00000700L 76#define DF_CS_AON0_DramBaseAddress0__IntLvAddrSel_MASK 0x00000700L
77#define DF_CS_AON0_DramBaseAddress0__DramBaseAddr_MASK 0xFFFFF000L 77#define DF_CS_AON0_DramBaseAddress0__DramBaseAddr_MASK 0xFFFFF000L
78static int vega10_force_clock_level(struct pp_hwmgr *hwmgr,
79 enum pp_clock_type type, uint32_t mask);
80 78
81static const ULONG PhwVega10_Magic = (ULONG)(PHM_VIslands_Magic); 79static const ULONG PhwVega10_Magic = (ULONG)(PHM_VIslands_Magic);
82 80
@@ -4095,6 +4093,47 @@ static void vega10_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
4095 } 4093 }
4096} 4094}
4097 4095
4096static int vega10_force_clock_level(struct pp_hwmgr *hwmgr,
4097 enum pp_clock_type type, uint32_t mask)
4098{
4099 struct vega10_hwmgr *data = hwmgr->backend;
4100
4101 switch (type) {
4102 case PP_SCLK:
4103 data->smc_state_table.gfx_boot_level = mask ? (ffs(mask) - 1) : 0;
4104 data->smc_state_table.gfx_max_level = mask ? (fls(mask) - 1) : 0;
4105
4106 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4107 "Failed to upload boot level to lowest!",
4108 return -EINVAL);
4109
4110 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4111 "Failed to upload dpm max level to highest!",
4112 return -EINVAL);
4113 break;
4114
4115 case PP_MCLK:
4116 data->smc_state_table.mem_boot_level = mask ? (ffs(mask) - 1) : 0;
4117 data->smc_state_table.mem_max_level = mask ? (fls(mask) - 1) : 0;
4118
4119 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4120 "Failed to upload boot level to lowest!",
4121 return -EINVAL);
4122
4123 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4124 "Failed to upload dpm max level to highest!",
4125 return -EINVAL);
4126
4127 break;
4128
4129 case PP_PCIE:
4130 default:
4131 break;
4132 }
4133
4134 return 0;
4135}
4136
4098static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, 4137static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
4099 enum amd_dpm_forced_level level) 4138 enum amd_dpm_forced_level level)
4100{ 4139{
@@ -4381,47 +4420,6 @@ static int vega10_set_watermarks_for_clocks_ranges(struct pp_hwmgr *hwmgr,
4381 return result; 4420 return result;
4382} 4421}
4383 4422
4384static int vega10_force_clock_level(struct pp_hwmgr *hwmgr,
4385 enum pp_clock_type type, uint32_t mask)
4386{
4387 struct vega10_hwmgr *data = hwmgr->backend;
4388
4389 switch (type) {
4390 case PP_SCLK:
4391 data->smc_state_table.gfx_boot_level = mask ? (ffs(mask) - 1) : 0;
4392 data->smc_state_table.gfx_max_level = mask ? (fls(mask) - 1) : 0;
4393
4394 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4395 "Failed to upload boot level to lowest!",
4396 return -EINVAL);
4397
4398 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4399 "Failed to upload dpm max level to highest!",
4400 return -EINVAL);
4401 break;
4402
4403 case PP_MCLK:
4404 data->smc_state_table.mem_boot_level = mask ? (ffs(mask) - 1) : 0;
4405 data->smc_state_table.mem_max_level = mask ? (fls(mask) - 1) : 0;
4406
4407 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4408 "Failed to upload boot level to lowest!",
4409 return -EINVAL);
4410
4411 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4412 "Failed to upload dpm max level to highest!",
4413 return -EINVAL);
4414
4415 break;
4416
4417 case PP_PCIE:
4418 default:
4419 break;
4420 }
4421
4422 return 0;
4423}
4424
4425static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, 4423static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
4426 enum pp_clock_type type, char *buf) 4424 enum pp_clock_type type, char *buf)
4427{ 4425{