diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2017-09-25 15:46:37 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-28 23:03:34 +0300 |
commit | 139a285f8124577ed816f63d9e950b01dfaa5401 (patch) | |
tree | 18c0834f954917e089dfedf9bf9d988b6137e640 /drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | |
parent | ba89a3ec61bde7d37225edf01f9e3c0c81de7f0f (diff) | |
download | linux-139a285f8124577ed816f63d9e950b01dfaa5401.tar.xz |
drm/amdgpu: create powerplay by cgs interface
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/drm/amd/amdgpu/amdgpu_powerplay.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c index eb886654ce44..1649b1e3f23d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c @@ -34,24 +34,6 @@ #include "cik_dpm.h" #include "vi_dpm.h" -static int amdgpu_create_pp_handle(struct amdgpu_device *adev) -{ - struct amd_pp_init pp_init; - struct amd_powerplay *amd_pp; - int ret; - - amd_pp = &(adev->powerplay); - pp_init.chip_family = adev->family; - pp_init.chip_id = adev->asic_type; - pp_init.pm_en = (amdgpu_dpm != 0 && !amdgpu_sriov_vf(adev)) ? true : false; - pp_init.feature_mask = amdgpu_pp_feature_mask; - pp_init.device = amd_pp->cgs_device; - ret = amd_powerplay_create(&pp_init, &(amd_pp->pp_handle)); - if (ret) - return -EINVAL; - return 0; -} - static int amdgpu_pp_early_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; @@ -73,8 +55,6 @@ static int amdgpu_pp_early_init(void *handle) case CHIP_VEGA10: case CHIP_RAVEN: amd_pp->cgs_device = amdgpu_cgs_create_device(adev); - if (amdgpu_create_pp_handle(adev)) - return -EINVAL; amd_pp->ip_funcs = &pp_ip_funcs; amd_pp->pp_funcs = &pp_dpm_funcs; break; @@ -97,8 +77,6 @@ static int amdgpu_pp_early_init(void *handle) amd_pp->pp_funcs = &ci_dpm_funcs; } else { amd_pp->cgs_device = amdgpu_cgs_create_device(adev); - if (amdgpu_create_pp_handle(adev)) - return -EINVAL; amd_pp->ip_funcs = &pp_ip_funcs; amd_pp->pp_funcs = &pp_dpm_funcs; } @@ -117,7 +95,8 @@ static int amdgpu_pp_early_init(void *handle) if (adev->powerplay.ip_funcs->early_init) ret = adev->powerplay.ip_funcs->early_init( - adev->powerplay.pp_handle); + amd_pp->cgs_device ? amd_pp->cgs_device : + amd_pp->pp_handle); if (ret == PP_DPM_DISABLED) { adev->pm.dpm_enabled = false; @@ -206,11 +185,8 @@ static void amdgpu_pp_late_fini(void *handle) adev->powerplay.ip_funcs->late_fini( adev->powerplay.pp_handle); - - if (adev->powerplay.cgs_device) { - amd_powerplay_destroy(adev->powerplay.pp_handle); + if (adev->powerplay.cgs_device) amdgpu_cgs_destroy_device(adev->powerplay.cgs_device); - } } static int amdgpu_pp_suspend(void *handle) |