diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-08-11 05:56:56 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-14 15:10:36 -0400 |
commit | 41698abb4d418b83b4d9fdae1172e00b91e46b54 (patch) | |
tree | d2546aa62bd5aae72a76236476ce4c93280e154a | |
parent | 00d57e6d6cb4a2b2c886935a9e1a1a2bcf26a85a (diff) |
drm/amd/powerplay: delete duplicated function and definition.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 files changed, 10 insertions, 25 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c index ca6347142120..2d72e06845b7 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #include "pp_acpi.h" | 35 | #include "pp_acpi.h" |
36 | #include "amd_acpi.h" | 36 | #include "amd_acpi.h" |
37 | 37 | ||
38 | #define VOLTAGE_SCALE 4 | ||
39 | |||
40 | extern int cz_hwmgr_init(struct pp_hwmgr *hwmgr); | 38 | extern int cz_hwmgr_init(struct pp_hwmgr *hwmgr); |
41 | extern int tonga_hwmgr_init(struct pp_hwmgr *hwmgr); | 39 | extern int tonga_hwmgr_init(struct pp_hwmgr *hwmgr); |
42 | extern int fiji_hwmgr_init(struct pp_hwmgr *hwmgr); | 40 | extern int fiji_hwmgr_init(struct pp_hwmgr *hwmgr); |
@@ -46,6 +44,11 @@ extern int iceland_hwmgr_init(struct pp_hwmgr *hwmgr); | |||
46 | static void hwmgr_init_default_caps(struct pp_hwmgr *hwmgr); | 44 | static void hwmgr_init_default_caps(struct pp_hwmgr *hwmgr); |
47 | static int hwmgr_set_user_specify_caps(struct pp_hwmgr *hwmgr); | 45 | static int hwmgr_set_user_specify_caps(struct pp_hwmgr *hwmgr); |
48 | 46 | ||
47 | uint8_t convert_to_vid(uint16_t vddc) | ||
48 | { | ||
49 | return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25); | ||
50 | } | ||
51 | |||
49 | int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle) | 52 | int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle) |
50 | { | 53 | { |
51 | struct pp_hwmgr *hwmgr; | 54 | struct pp_hwmgr *hwmgr; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c index 00e2e9a0e5ab..5abe43360ec0 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c | |||
@@ -1355,14 +1355,6 @@ static int iceland_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, | |||
1355 | return 0; | 1355 | return 0; |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | /** | ||
1359 | * Convert a voltage value in mv unit to VID number required by SMU firmware | ||
1360 | */ | ||
1361 | static uint8_t convert_to_vid(uint16_t vddc) | ||
1362 | { | ||
1363 | return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25); | ||
1364 | } | ||
1365 | |||
1366 | int iceland_populate_bapm_vddc_vid_sidd(struct pp_hwmgr *hwmgr) | 1358 | int iceland_populate_bapm_vddc_vid_sidd(struct pp_hwmgr *hwmgr) |
1367 | { | 1359 | { |
1368 | int i; | 1360 | int i; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c index 98318718b00f..d7c52be0fa46 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | |||
@@ -736,11 +736,6 @@ int polaris10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr) | |||
736 | return 0; | 736 | return 0; |
737 | } | 737 | } |
738 | 738 | ||
739 | uint8_t convert_to_vid(uint16_t vddc) | ||
740 | { | ||
741 | return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25); | ||
742 | } | ||
743 | |||
744 | /** | 739 | /** |
745 | * Mvdd table preparation for SMC. | 740 | * Mvdd table preparation for SMC. |
746 | * | 741 | * |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c index 50d020996f84..cf58f2256db1 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | |||
@@ -1317,15 +1317,6 @@ static int tonga_populate_smc_mvdd_table(struct pp_hwmgr *hwmgr, | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | /** | 1319 | /** |
1320 | * Convert a voltage value in mv unit to VID number required by SMU firmware | ||
1321 | */ | ||
1322 | static uint8_t convert_to_vid(uint16_t vddc) | ||
1323 | { | ||
1324 | return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25); | ||
1325 | } | ||
1326 | |||
1327 | |||
1328 | /** | ||
1329 | * Preparation of vddc and vddgfx CAC tables for SMC. | 1320 | * Preparation of vddc and vddgfx CAC tables for SMC. |
1330 | * | 1321 | * |
1331 | * @param hwmgr the address of the hardware manager | 1322 | * @param hwmgr the address of the hardware manager |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index 88a63b7523c8..7caf8d071ce7 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | |||
@@ -42,6 +42,10 @@ extern int amdgpu_powercontainment; | |||
42 | extern int amdgpu_sclk_deep_sleep_en; | 42 | extern int amdgpu_sclk_deep_sleep_en; |
43 | extern unsigned amdgpu_pp_feature_mask; | 43 | extern unsigned amdgpu_pp_feature_mask; |
44 | 44 | ||
45 | #define VOLTAGE_SCALE 4 | ||
46 | |||
47 | uint8_t convert_to_vid(uint16_t vddc); | ||
48 | |||
45 | enum DISPLAY_GAP { | 49 | enum DISPLAY_GAP { |
46 | DISPLAY_GAP_VBLANK_OR_WM = 0, /* Wait for vblank or MCHG watermark. */ | 50 | DISPLAY_GAP_VBLANK_OR_WM = 0, /* Wait for vblank or MCHG watermark. */ |
47 | DISPLAY_GAP_VBLANK = 1, /* Wait for vblank. */ | 51 | DISPLAY_GAP_VBLANK = 1, /* Wait for vblank. */ |
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c index 704ff4cc0023..8047ad221e74 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include "cgs_common.h" | 40 | #include "cgs_common.h" |
41 | 41 | ||
42 | #define POLARIS10_SMC_SIZE 0x20000 | 42 | #define POLARIS10_SMC_SIZE 0x20000 |
43 | #define VOLTAGE_SCALE 4 | ||
44 | 43 | ||
45 | /* Microcode file is stored in this buffer */ | 44 | /* Microcode file is stored in this buffer */ |
46 | #define BUFFER_SIZE 80000 | 45 | #define BUFFER_SIZE 80000 |
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c index 83d8f7eac22e..bbeb786db003 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "cgs_common.h" | 29 | #include "cgs_common.h" |
30 | #include "linux/delay.h" | 30 | #include "linux/delay.h" |
31 | 31 | ||
32 | |||
32 | int smum_init(struct amd_pp_init *pp_init, struct pp_instance *handle) | 33 | int smum_init(struct amd_pp_init *pp_init, struct pp_instance *handle) |
33 | { | 34 | { |
34 | struct pp_smumgr *smumgr; | 35 | struct pp_smumgr *smumgr; |