mise patches for powerplay module
Subsystems (2)
cover mise patches for powerplay module
Rex Zhu (7):
drm/amdgpu/powerplay: pp module only enable smu when dpm disabled. drm/amd/powerplay: use mask bit for deepsleep/power tune feature. drm/amdgpu: use mask bit for deep sleep feature on dpm. drm/amdgpu: delete duplicate module parameter. drm/amd/powerplay: fix code style
drm/amd/powerplay: enable voltage control by default for dgpu. drm/amd/powerplay: delete duplicate code in smu7_hwmgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 6 +-- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 51 +++++++++++++++++----- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 13 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 7 --- .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 5 ++- drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 - 13 files changed, 66 insertions(+), 46 deletions(-)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1478082461-23495-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 1/7 drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 6 +-- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 51 +++++++++++++++++------ drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 + 3 files changed, 44 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +3 -3
@@ -155,9 +155,6 @@ static int amdgpu_pp_sw_init(void *handle) ret = adev->powerplay.ip_funcs->sw_init ( adev->powerplay.pp_handle); -if (adev->pp_enabled) - adev->pm.dpm_enabled = true; -return ret; }
@@ -187,6 +184,9 @@ static int amdgpu_pp_hw_init(void *handle) ret = adev->powerplay.ip_funcs->hw_init ( adev->powerplay.pp_handle); +if (amdgpu_dpm !=0 ) + adev->pm.dpm_enabled = true; +return ret; }
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +39 -12
156 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h +2 -0
@@ -29,6 +29,8 @@#include "amd_shared.h" #include "cgs_common.h" +extern int amdgpu_dpm; +enum amd_pp_sensors {AMDGPU_PP_SENSOR_GFX_SCLK =0 ,AMDGPU_PP_SENSOR_VDDNB ,
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1478082461-23495-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 1/7] drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.
Quoted 37 lines · Rex Zhu
Change-Id I3288a5a4bbca122d59b81e7635be5e5aeda8abebSigned-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 6 +-- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 51 +++++++++++++++++------ drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 + 3 files changed, 44 insertions(+), 15 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +3
-3@@ -155,9 +155,6 @@ static int amdgpu_pp_sw_init(void *handle) ret = adev->powerplay.ip_funcs->sw_init ( adev->powerplay.pp_handle); -if (adev->pp_enabled) - adev->pm.dpm_enabled = true; -return ret; }@@ -187,6 +184,9 @@ static int amdgpu_pp_hw_init(void *handle) ret = adev->powerplay.ip_funcs->hw_init ( adev->powerplay.pp_handle); +if (amdgpu_dpm !=0 ) + adev->pm.dpm_enabled = true; +return ret; }drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0
-0
drivers/gpu/drm/amd/powerplay/amd_powerplay.c line 44
Quoted 5 lines
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1
-1@@ -41,7 +41,7 @@#define PP_CHECK_HW (hwmgr) \ do { \ if ((hwmgr) == NULL || (hwmgr)->hwmgr_func == NULL) \ - return -EINVAL; \ + return 0; \
Is that really the right thing to do? With it functions like pp_dpm_get_fan_speed_percent() pp_dpm_read_sensor() will succeed but not set the values and callers will use uninitialized data (leak kernel stack contents, so it can be considered a security issue even).
Gražvydas
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CANOLnOPcvt5N3uHioSD1AAHX5MPMhBPUo5EpNw3j8s4O602tPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
RE: [PATCH 1/7] drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.
Hi Gražvydas,
Only in case dpm was disabled, we didn't initialize hwmgr and hwmgr->hwmgr_func. In this case, we just use smu to load firmware. All the power feature will be disabled. And the sysfs and debugfs files will not be initialized.
Best Regards
Rex
-----Original Message-----
From: Grazvydas Ignotas [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 9:17 PM
To: Zhu, Rex
Cc: [email protected]
Subject: Re: [PATCH 1/7] drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.
Quoted 39 lines · Rex Zhu
Change-Id I3288a5a4bbca122d59b81e7635be5e5aeda8abebSigned-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 6 +-- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 51 +++++++++++++++++------ drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 + 3 files changed, 44 insertions(+), 15 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +3
-3@@ -155,9 +155,6 @@ static int amdgpu_pp_sw_init(void *handle) ret = adev->powerplay.ip_funcs->sw_init ( adev->powerplay.pp_handle); -if (adev->pp_enabled) - adev->pm.dpm_enabled = true; -return ret; }@@ -187,6 +184,9 @@ static int amdgpu_pp_hw_init(void *handle) ret = adev->powerplay.ip_funcs->hw_init ( adev->powerplay.pp_handle); +if (amdgpu_dpm !=0 ) + adev->pm.dpm_enabled = true; +return ret; }drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0
-0
drivers/gpu/drm/amd/powerplay/amd_powerplay.c line 44
Quoted 5 lines
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1
-1@@ -41,7 +41,7 @@#define PP_CHECK_HW (hwmgr) \ do { \ if ((hwmgr) == NULL || (hwmgr)->hwmgr_func == NULL) \ - return -EINVAL; \ + return 0; \
Is that really the right thing to do? With it functions likepp_dpm_get_fan_speed_percent() pp_dpm_read_sensor() will succeed but not set the values and callers will use uninitialized data (leak kernel stack contents, so it can be considered a security issue even).
Gražvydas
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 drm/amd/powerplay: use mask bit for deepsleep/power tune feature.
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 ++-- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -2
@@ -685,14 +685,14 @@ void hwmgr_init_default_caps(struct pp_hwmgr *hwmgr)int hwmgr_set_user_specify_caps (struct pp_hwmgr *hwmgr) { -if (amdgpu_sclk_deep_sleep_en) +if (amdgpu_pp_feature_mask &PP_SCLK_DEEP_SLEEP_MASK )phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep);else phm_cap_unset (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep); -if (amdgpu_powercontainment) { +if (amdgpu_pp_feature_mask &PP_POWER_CONTAINMENT_MASK ) {phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_PowerContainment); phm_cap_set(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +0 -2
@@ -38,8 +38,6 @@ struct pp_hwmgr;struct phm_fan_speed_info ;struct pp_atomctrl_voltage_table ; -extern int amdgpu_powercontainment; -extern int amdgpu_sclk_deep_sleep_en;extern unsigned amdgpu_pp_feature_mask;#define VOLTAGE_SCALE 4
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amdgpu: use mask bit for deep sleep feature on dpm.
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 2 ++ drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +2 -0
@@ -52,6 +52,8 @@ enum amdgpu_dpm_event_src {AMDGPU_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL =4 }; +#define SCLK_DEEP_SLEEP_MASK 0x8 +struct amdgpu_ps {u32 caps;/* vbios flags */ u32 class;/* vbios flags */
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +1 -1
@@ -5896,7 +5896,7 @@ static int ci_dpm_init(struct amdgpu_device *adev) pi->pcie_dpm_key_disabled =0 ; pi->thermal_sclk_dpm_enabled =0 ; -if (amdgpu_sclk_deep_sleep_en) +if (amdgpu_pp_feature_mask &SCLK_DEEP_SLEEP_MASK ) pi->caps_sclk_ds = true;else pi->caps_sclk_ds = false;
drivers/gpu/drm/amd/amdgpu/cz_dpm.c +1 -1
@@ -438,7 +438,7 @@ static int cz_dpm_init(struct amdgpu_device *adev) pi->caps_td_ramping = true; pi->caps_tcp_ramping = true; } -if (amdgpu_sclk_deep_sleep_en) +if (amdgpu_pp_feature_mask &SCLK_DEEP_SLEEP_MASK ) pi->caps_sclk_ds = true;else pi->caps_sclk_ds = false;
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1 -1
@@ -2845,7 +2845,7 @@ static int kv_dpm_init(struct amdgpu_device *adev) pi->caps_tcp_ramping = true; } -if (amdgpu_sclk_deep_sleep_en) +if (amdgpu_pp_feature_mask &SCLK_DEEP_SLEEP_MASK ) pi->caps_sclk_ds = true;else pi->caps_sclk_ds = false;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amdgpu: delete duplicate module parameter.
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 -2
@@ -94,13 +94,13 @@ extern int amdgpu_dal;extern int amdgpu_sched_jobs;extern int amdgpu_sched_hw_submission;extern int amdgpu_powerplay; -extern int amdgpu_powercontainment; +extern int amdgpu_no_evict; +extern int amdgpu_direct_gma_size;extern unsigned amdgpu_pcie_gen_cap;extern unsigned amdgpu_pcie_lane_cap;extern unsigned amdgpu_cg_mask;extern unsigned amdgpu_pg_mask;extern char *amdgpu_disable_cu; -extern int amdgpu_sclk_deep_sleep_en;extern char *amdgpu_virtual_display;extern unsigned amdgpu_pp_feature_mask;extern int amdgpu_vram_page_split;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +7 -7
@@ -92,8 +92,8 @@ int amdgpu_dal = -1;int amdgpu_sched_jobs =32 ;int amdgpu_sched_hw_submission =2 ;int amdgpu_powerplay =-1 ; -int amdgpu_powercontainment =1 ; -int amdgpu_sclk_deep_sleep_en =1 ; +int amdgpu_no_evict =0 ; +int amdgpu_direct_gma_size =0 ;unsigned amdgpu_pcie_gen_cap =0 ;unsigned amdgpu_pcie_lane_cap =0 ;unsigned amdgpu_cg_mask =0xffffffff ;
@@ -186,14 +186,14 @@ module_param_named(sched_hw_submission, amdgpu_sched_hw_submission, int, 0444);MODULE_PARM_DESC (powerplay,"Powerplay component (1 = enable, 0 = disable, -1 = auto (default))" );module_param_named (powerplay, amdgpu_powerplay, int,0444 ); -MODULE_PARM_DESC (powercontainment,"Power Containment (1 = enable (default), 0 = disable)" ); -module_param_named (powercontainment, amdgpu_powercontainment, int,0444 ); -MODULE_PARM_DESC (ppfeaturemask,"all power features enabled (default))" );module_param_named (ppfeaturemask, amdgpu_pp_feature_mask, int,0444 ); -MODULE_PARM_DESC (sclkdeepsleep,"SCLK Deep Sleep (1 = enable (default), 0 = disable)" ); -module_param_named (sclkdeepsleep, amdgpu_sclk_deep_sleep_en, int,0444 ); +MODULE_PARM_DESC (no_evict,"Support pinning request from user space (1 = enable, 0 = disable (default))" ); +module_param_named (no_evict, amdgpu_no_evict, int,0444 ); + +MODULE_PARM_DESC (direct_gma_size,"Direct GMA size in megabytes (max 96MB)" ); +module_param_named (direct_gma_size, amdgpu_direct_gma_size, int,0444 );MODULE_PARM_DESC (pcie_gen_cap,"PCIE Gen Caps (0: autodetect (default))" );module_param_named (pcie_gen_cap, amdgpu_pcie_gen_cap, uint,0444 );
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amd/powerplay: fix code style
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c +3 -2
@@ -603,9 +603,10 @@ int smu7_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n)return 0 ; } -static int smu7_set_overdriver_target_tdp (struct pp_hwmgr *pHwMgr,uint32_t target_tdp) +static int smu7_set_overdriver_target_tdp (struct pp_hwmgr *hwmgr, +uint32_t target_tdp) { -return smum_send_msg_to_smc_with_parameter (pHwMgr->smumgr, +return smum_send_msg_to_smc_with_parameter (hwmgr->smumgr, PPSMC_MSG_OverDriveSetTargetTdp, target_tdp); }
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amd/powerplay: enable voltage control by default for dgpu.
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +3 -6
@@ -80,20 +80,17 @@ int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle)switch (hwmgr->chip_id) {case CHIP_TOPAZ :topaz_set_asic_special_caps (hwmgr); - hwmgr->feature_mask &= ~(PP_SMC_VOLTAGE_CONTROL_MASK | -PP_VBI_TIME_SUPPORT_MASK | + hwmgr->feature_mask &= ~ (PP_VBI_TIME_SUPPORT_MASK |PP_ENABLE_GFX_CG_THRU_SMU ); hwmgr->pp_table_version =PP_TABLE_V0 ;break ;case CHIP_TONGA :tonga_set_asic_special_caps (hwmgr); - hwmgr->feature_mask &= ~(PP_SMC_VOLTAGE_CONTROL_MASK | -PP_VBI_TIME_SUPPORT_MASK ); + hwmgr->feature_mask &= ~PP_VBI_TIME_SUPPORT_MASK ;break ;case CHIP_FIJI :fiji_set_asic_special_caps (hwmgr); - hwmgr->feature_mask &= ~(PP_SMC_VOLTAGE_CONTROL_MASK | -PP_VBI_TIME_SUPPORT_MASK | + hwmgr->feature_mask &= ~ (PP_VBI_TIME_SUPPORT_MASK |PP_ENABLE_GFX_CG_THRU_SMU );break ;case CHIP_POLARIS11 :
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amd/powerplay: delete duplicate code in smu7_hwmgr.c
In reply to a message not in the archiveVoltage Controller have been enabled (SMC message) before ULV enablement.
Change-Id: I4833c8d53611c8b93712254d5a152ae8e98a7d78
--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +0 -7
@@ -993,13 +993,6 @@ static int smu7_start_dpm(struct pp_hwmgr *hwmgr)PHM_WRITE_INDIRECT_FIELD (hwmgr->device,CGS_IND_REG__PCIE ,SWRST_COMMAND_1 ,RESETLC ,0x0 ); -PP_ASSERT_WITH_CODE ( - (0 ==smum_send_msg_to_smc (hwmgr->smumgr, - PPSMC_MSG_Voltage_Cntl_Enable)), -"Failed to enable voltage DPM during DPM Start Function!" , - return -EINVAL ); - -if (smu7_enable_sclk_mclk_dpm (hwmgr)) {printk (KERN_ERR "Failed to enable Sclk DPM and Mclk DPM!" );return -EINVAL ;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Wednesday, November 02, 2016 6:28 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH 0/7] mise patches for powerplay module
Quoted 8 lines
Rex Zhu (7):
drm/amdgpu/powerplay: pp module only enable smu when dpm disabled. drm/amd/powerplay: use mask bit for deepsleep/power tune feature. drm/amdgpu: use mask bit for deep sleep feature on dpm. drm/amdgpu: delete duplicate module parameter. drm/amd/powerplay: fix code style
drm/amd/powerplay: enable voltage control by default for dgpu. drm/amd/powerplay: delete duplicate code insmu7_hwmgr.c
Series is:
Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 6 +-- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 51 +++++++++++++++++----- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 13 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 7 --- .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 5 ++- drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 - 13 files changed, 66 insertions(+), 46 deletions(-)
Quoted 7 lines
--
1.9.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx