mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
drm/amd/pm: only poweron/off vcn/jpeg when they are valid.
If vcn is disabled in kernel parameters, don't touch vcn, otherwise it may cause vcn hang. v2: delete unnecessary logs v3: move "is_vcn_enabled" check to smu_dpm_setvcn/jpeg_enable (Evan) Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
813ba1ff84
commit
2e3b2cb9b8
|
|
@ -215,6 +215,20 @@ static int smu_set_gfx_imu_enable(struct smu_context *smu)
|
|||
return smu_set_gfx_power_up_by_imu(smu);
|
||||
}
|
||||
|
||||
static bool is_vcn_enabled(struct amdgpu_device *adev)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if ((adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_VCN ||
|
||||
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_JPEG) &&
|
||||
!adev->ip_blocks[i].status.valid)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int smu_dpm_set_vcn_enable(struct smu_context *smu,
|
||||
bool enable)
|
||||
{
|
||||
|
|
@ -222,6 +236,12 @@ static int smu_dpm_set_vcn_enable(struct smu_context *smu,
|
|||
struct smu_power_gate *power_gate = &smu_power->power_gate;
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
* don't poweron vcn/jpeg when they are skipped.
|
||||
*/
|
||||
if (!is_vcn_enabled(smu->adev))
|
||||
return 0;
|
||||
|
||||
if (!smu->ppt_funcs->dpm_set_vcn_enable)
|
||||
return 0;
|
||||
|
||||
|
|
@ -242,6 +262,9 @@ static int smu_dpm_set_jpeg_enable(struct smu_context *smu,
|
|||
struct smu_power_gate *power_gate = &smu_power->power_gate;
|
||||
int ret = 0;
|
||||
|
||||
if (!is_vcn_enabled(smu->adev))
|
||||
return 0;
|
||||
|
||||
if (!smu->ppt_funcs->dpm_set_jpeg_enable)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user