diff options
| author | Alex Deucher <[email protected]> | 2019-07-25 10:55:25 -0500 | 
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2019-07-30 23:24:39 -0500 | 
| commit | e254102d5079f83376b6b6b227e546bcde89683c (patch) | |
| tree | 27e3059ab22b0b50ce0b35d519b0e99dbc03eacb | |
| parent | a906277d22f790418e68a2ad0feba6617b165d40 (diff) | |
drm/amdgpu/powerplay: add set_mp1_state for vega10
This sets the SMU into the proper state for various
operations (shutdown, unload, GPU reset, etc.).
Reviewed-by: Evan Quan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c index 3be8eb21fd6e..948c54cb9c5d 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c @@ -5219,6 +5219,30 @@ static int vega10_odn_edit_dpm_table(struct pp_hwmgr *hwmgr,  	return 0;  } +static int vega10_set_mp1_state(struct pp_hwmgr *hwmgr, +				enum pp_mp1_state mp1_state) +{ +	uint16_t msg; +	int ret; + +	switch (mp1_state) { +	case PP_MP1_STATE_UNLOAD: +		msg = PPSMC_MSG_PrepareMp1ForUnload; +		break; +	case PP_MP1_STATE_SHUTDOWN: +	case PP_MP1_STATE_RESET: +	case PP_MP1_STATE_NONE: +	default: +		return 0; +	} + +	PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr, msg)) == 0, +			    "[PrepareMp1] Failed!", +			    return ret); + +	return 0; +} +  static int vega10_get_performance_level(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *state,  				PHM_PerformanceLevelDesignation designation, uint32_t index,  				PHM_PerformanceLevel *level) @@ -5308,6 +5332,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {  	.enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,  	.get_ppfeature_status = vega10_get_ppfeature_status,  	.set_ppfeature_status = vega10_set_ppfeature_status, +	.set_mp1_state = vega10_set_mp1_state,  };  int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) |