mirror of https://gitee.com/openkylin/linux.git
drm/amdgpu: enable JPEG2.0 dpm
By using its own enabling function Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0db2ab99c9
commit
474b6d296f
|
@ -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 ret = 0;
|
||||
|
|
|
@ -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_enable_uvd(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
|
||||
|
|
|
@ -333,6 +333,9 @@ static int jpeg_v2_0_start(struct amdgpu_device *adev)
|
|||
struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec;
|
||||
int r;
|
||||
|
||||
if (adev->pm.dpm_enabled)
|
||||
amdgpu_dpm_enable_jpeg(adev, true);
|
||||
|
||||
/* disable power gating */
|
||||
r = jpeg_v2_0_disable_power_gating(adev);
|
||||
if (r)
|
||||
|
@ -388,8 +391,13 @@ static int jpeg_v2_0_stop(struct amdgpu_device *adev)
|
|||
|
||||
/* enable power gating */
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue