diff options
author | Kevin Wang <kevin1.wang@amd.com> | 2019-01-25 02:10:13 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 16:04:00 -0400 |
commit | 72e91f37a81768c81aa7ac78169f5a3259c621ac (patch) | |
tree | 157ab507baff676b43877e21223071ef1d2db1f9 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | 41a84248ee39392251c24c9e7c76646695837440 (diff) |
drm/amd/powerplay: implement dpm enable functions of uvd & vce for smu
add function of dpm enable uvd & vce for extern module use.
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index a1faf3f8702e..b83981284a7c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -2347,7 +2347,13 @@ static void amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev) | |||
2347 | 2347 | ||
2348 | void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable) | 2348 | void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable) |
2349 | { | 2349 | { |
2350 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) { | 2350 | int ret = 0; |
2351 | if (is_support_sw_smu(adev)) { | ||
2352 | ret = smu_dpm_set_power_gate(&adev->smu, AMD_IP_BLOCK_TYPE_UVD, enable); | ||
2353 | if (ret) | ||
2354 | DRM_ERROR("[SW SMU]: dpm enable uvd failed, state = %s, ret = %d. \n", | ||
2355 | enable ? "true" : "false", ret); | ||
2356 | } else if (adev->powerplay.pp_funcs->set_powergating_by_smu) { | ||
2351 | /* enable/disable UVD */ | 2357 | /* enable/disable UVD */ |
2352 | mutex_lock(&adev->pm.mutex); | 2358 | mutex_lock(&adev->pm.mutex); |
2353 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_UVD, !enable); | 2359 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_UVD, !enable); |
@@ -2368,7 +2374,13 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable) | |||
2368 | 2374 | ||
2369 | void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) | 2375 | void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) |
2370 | { | 2376 | { |
2371 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) { | 2377 | int ret = 0; |
2378 | if (is_support_sw_smu(adev)) { | ||
2379 | ret = smu_dpm_set_power_gate(&adev->smu, AMD_IP_BLOCK_TYPE_VCE, enable); | ||
2380 | if (ret) | ||
2381 | DRM_ERROR("[SW SMU]: dpm enable vce failed, state = %s, ret = %d. \n", | ||
2382 | enable ? "true" : "false", ret); | ||
2383 | } else if (adev->powerplay.pp_funcs->set_powergating_by_smu) { | ||
2372 | /* enable/disable VCE */ | 2384 | /* enable/disable VCE */ |
2373 | mutex_lock(&adev->pm.mutex); | 2385 | mutex_lock(&adev->pm.mutex); |
2374 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_VCE, !enable); | 2386 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_VCE, !enable); |