Commit 474b6d29 authored by Leo Liu's avatar Leo Liu Committed by Alex Deucher

drm/amdgpu: enable JPEG2.0 dpm

By using its own enabling function
Signed-off-by: default avatarLeo Liu <leo.liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0db2ab99
...@@ -2718,6 +2718,18 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev) ...@@ -2718,6 +2718,18 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
} }
void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable)
{
int ret = 0;
if (is_support_sw_smu(adev)) {
ret = smu_dpm_set_power_gate(&adev->smu, AMD_IP_BLOCK_TYPE_JPEG, enable);
if (ret)
DRM_ERROR("[SW SMU]: dpm enable jpeg failed, state = %s, ret = %d. \n",
enable ? "true" : "false", ret);
}
}
int amdgpu_pm_virt_sysfs_init(struct amdgpu_device *adev) int amdgpu_pm_virt_sysfs_init(struct amdgpu_device *adev)
{ {
int ret = 0; int ret = 0;
......
...@@ -41,5 +41,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev); ...@@ -41,5 +41,6 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev);
void amdgpu_dpm_thermal_work_handler(struct work_struct *work); void amdgpu_dpm_thermal_work_handler(struct work_struct *work);
void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable);
void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable);
void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable);
#endif #endif
...@@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev) ...@@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev)
struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec; struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec;
int r; int r;
if (adev->pm.dpm_enabled)
amdgpu_dpm_enable_jpeg(adev, true);
/* disable power gating */ /* disable power gating */
r = jpeg_v2_0_disable_power_gating(adev); r = jpeg_v2_0_disable_power_gating(adev);
if (r) if (r)
...@@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev) ...@@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev)
/* enable power gating */ /* enable power gating */
r = jpeg_v2_0_enable_power_gating(adev); r = jpeg_v2_0_enable_power_gating(adev);
if (r)
return r;
return r; if (adev->pm.dpm_enabled)
amdgpu_dpm_enable_jpeg(adev, false);
return 0;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment