diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-01-24 09:57:18 -0800 | 
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-01-24 09:57:18 -0800 | 
| commit | 62ed8ceda1699acae01b666497f004bfd3d67a6f (patch) | |
| tree | fe38c83c49dfd568b540666948ef78cb9d082c38 /drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | |
| parent | 1c3415a06b1016a596bfe59e0cfee56c773aa958 (diff) | |
| parent | 7a308bb3016f57e5be11a677d15b821536419d36 (diff) | |
Merge tag 'v4.10-rc5' into for-linus
Sync up with mainline to apply fixup to a commit that came through
power supply tree.
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 60 | 
1 files changed, 28 insertions, 32 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c index c5738a22b690..95a568df8551 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c @@ -30,6 +30,7 @@  #include "amdgpu_pm.h"  #include <drm/amdgpu_drm.h>  #include "amdgpu_powerplay.h" +#include "si_dpm.h"  #include "cik_dpm.h"  #include "vi_dpm.h" @@ -41,7 +42,6 @@ static int amdgpu_powerplay_init(struct amdgpu_device *adev)  	amd_pp = &(adev->powerplay);  	if (adev->pp_enabled) { -#ifdef CONFIG_DRM_AMD_POWERPLAY  		struct amd_pp_init *pp_init;  		pp_init = kzalloc(sizeof(struct amd_pp_init), GFP_KERNEL); @@ -52,15 +52,21 @@ static int amdgpu_powerplay_init(struct amdgpu_device *adev)  		pp_init->chip_family = adev->family;  		pp_init->chip_id = adev->asic_type;  		pp_init->device = amdgpu_cgs_create_device(adev); -		pp_init->powercontainment_enabled = amdgpu_powercontainment; -  		ret = amd_powerplay_init(pp_init, amd_pp);  		kfree(pp_init); -#endif  	} else {  		amd_pp->pp_handle = (void *)adev;  		switch (adev->asic_type) { +#ifdef CONFIG_DRM_AMDGPU_SI +		case CHIP_TAHITI: +		case CHIP_PITCAIRN: +		case CHIP_VERDE: +		case CHIP_OLAND: +		case CHIP_HAINAN: +			amd_pp->ip_funcs = &si_dpm_ip_funcs; +		break; +#endif  #ifdef CONFIG_DRM_AMDGPU_CIK  		case CHIP_BONAIRE:  		case CHIP_HAWAII: @@ -72,15 +78,6 @@ static int amdgpu_powerplay_init(struct amdgpu_device *adev)  			amd_pp->ip_funcs = &kv_dpm_ip_funcs;  			break;  #endif -		case CHIP_TOPAZ: -			amd_pp->ip_funcs = &iceland_dpm_ip_funcs; -			break; -		case CHIP_TONGA: -			amd_pp->ip_funcs = &tonga_dpm_ip_funcs; -			break; -		case CHIP_FIJI: -			amd_pp->ip_funcs = &fiji_dpm_ip_funcs; -			break;  		case CHIP_CARRIZO:  		case CHIP_STONEY:  			amd_pp->ip_funcs = &cz_dpm_ip_funcs; @@ -98,19 +95,18 @@ static int amdgpu_pp_early_init(void *handle)  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;  	int ret = 0; -#ifdef CONFIG_DRM_AMD_POWERPLAY  	switch (adev->asic_type) {  	case CHIP_POLARIS11:  	case CHIP_POLARIS10: -		adev->pp_enabled = true; -		break; +	case CHIP_POLARIS12:  	case CHIP_TONGA:  	case CHIP_FIJI: -		adev->pp_enabled = (amdgpu_powerplay == 0) ? false : true; +	case CHIP_TOPAZ: +		adev->pp_enabled = true;  		break;  	case CHIP_CARRIZO:  	case CHIP_STONEY: -		adev->pp_enabled = (amdgpu_powerplay > 0) ? true : false; +		adev->pp_enabled = (amdgpu_powerplay == 0) ? false : true;  		break;  	/* These chips don't have powerplay implemenations */  	case CHIP_BONAIRE: @@ -118,14 +114,10 @@ static int amdgpu_pp_early_init(void *handle)  	case CHIP_KABINI:  	case CHIP_MULLINS:  	case CHIP_KAVERI: -	case CHIP_TOPAZ:  	default:  		adev->pp_enabled = false;  		break;  	} -#else -	adev->pp_enabled = false; -#endif  	ret = amdgpu_powerplay_init(adev);  	if (ret) @@ -147,12 +139,11 @@ static int amdgpu_pp_late_init(void *handle)  		ret = adev->powerplay.ip_funcs->late_init(  					adev->powerplay.pp_handle); -#ifdef CONFIG_DRM_AMD_POWERPLAY  	if (adev->pp_enabled && adev->pm.dpm_enabled) {  		amdgpu_pm_sysfs_init(adev);  		amdgpu_dpm_dispatch_task(adev, AMD_PP_EVENT_COMPLETE_INIT, NULL, NULL);  	} -#endif +  	return ret;  } @@ -165,11 +156,6 @@ static int amdgpu_pp_sw_init(void *handle)  		ret = adev->powerplay.ip_funcs->sw_init(  					adev->powerplay.pp_handle); -#ifdef CONFIG_DRM_AMD_POWERPLAY -	if (adev->pp_enabled) -		adev->pm.dpm_enabled = true; -#endif -  	return ret;  } @@ -199,6 +185,9 @@ static int amdgpu_pp_hw_init(void *handle)  		ret = adev->powerplay.ip_funcs->hw_init(  					adev->powerplay.pp_handle); +	if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev)) +		adev->pm.dpm_enabled = true; +  	return ret;  } @@ -219,7 +208,6 @@ static int amdgpu_pp_hw_fini(void *handle)  static void amdgpu_pp_late_fini(void *handle)  { -#ifdef CONFIG_DRM_AMD_POWERPLAY  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;  	if (adev->pp_enabled) { @@ -230,7 +218,6 @@ static void amdgpu_pp_late_fini(void *handle)  	if (adev->powerplay.ip_funcs->late_fini)  		adev->powerplay.ip_funcs->late_fini(  			  adev->powerplay.pp_handle); -#endif  }  static int amdgpu_pp_suspend(void *handle) @@ -313,7 +300,7 @@ static int amdgpu_pp_soft_reset(void *handle)  	return ret;  } -const struct amd_ip_funcs amdgpu_pp_ip_funcs = { +static const struct amd_ip_funcs amdgpu_pp_ip_funcs = {  	.name = "amdgpu_powerplay",  	.early_init = amdgpu_pp_early_init,  	.late_init = amdgpu_pp_late_init, @@ -330,3 +317,12 @@ const struct amd_ip_funcs amdgpu_pp_ip_funcs = {  	.set_clockgating_state = amdgpu_pp_set_clockgating_state,  	.set_powergating_state = amdgpu_pp_set_powergating_state,  }; + +const struct amdgpu_ip_block_version amdgpu_pp_ip_block = +{ +	.type = AMD_IP_BLOCK_TYPE_SMC, +	.major = 1, +	.minor = 0, +	.rev = 0, +	.funcs = &amdgpu_pp_ip_funcs, +};  | 
