aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-01-04 03:42:06 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-19 14:17:55 -0500
commit11f64ff5f323d697d0e3be932aaaaa5b38b144cd (patch)
treed60a52b7c3b1cd1c9e4cfcddb361eb9199983e17 /drivers/gpu
parent59fc8cde739bc81464d214b23fd717f24608eb75 (diff)
drm/amd/pp: Add a new pp feature mask bit for OD feature
when this bit was set on module load, driver will allow the user over/under gpu clock and voltage through sysfs. by default, this bit was not set. 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/amdgpu/amdgpu_drv.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c3
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c7
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hwmgr.h2
5 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0bb34db265ec..46a0c937e8f0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -120,7 +120,7 @@ uint amdgpu_pg_mask = 0xffffffff;
120uint amdgpu_sdma_phase_quantum = 32; 120uint amdgpu_sdma_phase_quantum = 32;
121char *amdgpu_disable_cu = NULL; 121char *amdgpu_disable_cu = NULL;
122char *amdgpu_virtual_display = NULL; 122char *amdgpu_virtual_display = NULL;
123uint amdgpu_pp_feature_mask = 0xffffffff; 123uint amdgpu_pp_feature_mask = 0x3fff;
124int amdgpu_ngg = 0; 124int amdgpu_ngg = 0;
125int amdgpu_prim_buf_per_se = 0; 125int amdgpu_prim_buf_per_se = 0;
126int amdgpu_pos_buf_per_se = 0; 126int amdgpu_pos_buf_per_se = 0;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index e35bdc5bafb7..26904462d23a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -935,6 +935,9 @@ int hwmgr_set_user_specify_caps(struct pp_hwmgr *hwmgr)
935 PHM_PlatformCaps_CAC); 935 PHM_PlatformCaps_CAC);
936 } 936 }
937 937
938 if (hwmgr->feature_mask & PP_OVERDRIVE_MASK)
939 hwmgr->od_enabled = true;
940
938 return 0; 941 return 0;
939} 942}
940 943
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 11a900bb7f8c..9f62cb1bc58f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3572,8 +3572,7 @@ static int smu7_populate_and_upload_sclk_mclk_dpm_levels(
3572 dpm_table->sclk_table.dpm_levels 3572 dpm_table->sclk_table.dpm_levels
3573 [dpm_table->sclk_table.count - 1].value = sclk; 3573 [dpm_table->sclk_table.count - 1].value = sclk;
3574 3574
3575 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_OD6PlusinACSupport) || 3575 if (hwmgr->od_enabled) {
3576 phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_OD6PlusinDCSupport)) {
3577 /* Need to do calculation based on the golden DPM table 3576 /* Need to do calculation based on the golden DPM table
3578 * as the Heatmap GPU Clock axis is also based on the default values 3577 * as the Heatmap GPU Clock axis is also based on the default values
3579 */ 3578 */
@@ -3618,8 +3617,7 @@ static int smu7_populate_and_upload_sclk_mclk_dpm_levels(
3618 dpm_table->mclk_table.dpm_levels 3617 dpm_table->mclk_table.dpm_levels
3619 [dpm_table->mclk_table.count - 1].value = mclk; 3618 [dpm_table->mclk_table.count - 1].value = mclk;
3620 3619
3621 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_OD6PlusinACSupport) || 3620 if (hwmgr->od_enabled) {
3622 phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_OD6PlusinDCSupport)) {
3623 3621
3624 PP_ASSERT_WITH_CODE( 3622 PP_ASSERT_WITH_CODE(
3625 (golden_dpm_table->mclk_table.dpm_levels 3623 (golden_dpm_table->mclk_table.dpm_levels
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index fdb8d3457ed1..762650dd4f08 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -3396,8 +3396,7 @@ static int vega10_populate_and_upload_sclk_mclk_dpm_levels(
3396 dpm_table-> 3396 dpm_table->
3397 gfx_table.dpm_levels[dpm_table->gfx_table.count - 1]. 3397 gfx_table.dpm_levels[dpm_table->gfx_table.count - 1].
3398 value = sclk; 3398 value = sclk;
3399 if (PP_CAP(PHM_PlatformCaps_OD6PlusinACSupport) || 3399 if (hwmgr->od_enabled) {
3400 PP_CAP(PHM_PlatformCaps_OD6PlusinDCSupport)) {
3401 /* Need to do calculation based on the golden DPM table 3400 /* Need to do calculation based on the golden DPM table
3402 * as the Heatmap GPU Clock axis is also based on 3401 * as the Heatmap GPU Clock axis is also based on
3403 * the default values 3402 * the default values
@@ -3451,9 +3450,7 @@ static int vega10_populate_and_upload_sclk_mclk_dpm_levels(
3451 mem_table.dpm_levels[dpm_table->mem_table.count - 1]. 3450 mem_table.dpm_levels[dpm_table->mem_table.count - 1].
3452 value = mclk; 3451 value = mclk;
3453 3452
3454 if (PP_CAP(PHM_PlatformCaps_OD6PlusinACSupport) || 3453 if (hwmgr->od_enabled) {
3455 PP_CAP(PHM_PlatformCaps_OD6PlusinDCSupport)) {
3456
3457 PP_ASSERT_WITH_CODE( 3454 PP_ASSERT_WITH_CODE(
3458 golden_dpm_table->mem_table.dpm_levels 3455 golden_dpm_table->mem_table.dpm_levels
3459 [golden_dpm_table->mem_table.count - 1].value, 3456 [golden_dpm_table->mem_table.count - 1].value,
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 6d8183dcb0ec..7caab09d1436 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -84,6 +84,7 @@ enum PP_FEATURE_MASK {
84 PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800, 84 PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800,
85 PP_SOCCLK_DPM_MASK = 0x1000, 85 PP_SOCCLK_DPM_MASK = 0x1000,
86 PP_DCEFCLK_DPM_MASK = 0x2000, 86 PP_DCEFCLK_DPM_MASK = 0x2000,
87 PP_OVERDRIVE_MASK = 0x4000,
87}; 88};
88 89
89enum PHM_BackEnd_Magic { 90enum PHM_BackEnd_Magic {
@@ -755,6 +756,7 @@ struct pp_hwmgr {
755 uint32_t power_profile_mode; 756 uint32_t power_profile_mode;
756 uint32_t pstate_sclk; 757 uint32_t pstate_sclk;
757 uint32_t pstate_mclk; 758 uint32_t pstate_mclk;
759 bool od_enabled;
758}; 760};
759 761
760struct cgs_irq_src_funcs { 762struct cgs_irq_src_funcs {