[PATCH] drm/amd/pm: Return auto perf level, if unsupported

Lazar, Lijo lijo.lazar at amd.com
Tue May 24 13:25:53 UTC 2022



On 5/24/2022 6:49 PM, Alex Deucher wrote:
> On Tue, May 24, 2022 at 8:36 AM Lijo Lazar <lijo.lazar at amd.com> wrote:
>>
>> When powerplay is not enabled, return AUTO as default level.
>>
>> Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
>> ---
>>   drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
>> index 5472f9936feb..d1bf073adf54 100644
>> --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
>> +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
>> @@ -770,6 +770,9 @@ enum amd_dpm_forced_level amdgpu_dpm_get_performance_level(struct amdgpu_device
>>          const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
>>          enum amd_dpm_forced_level level;
>>
>> +       if (!pp_funcs)
>> +               return AMD_DPM_FORCED_LEVEL_AUTO;
> 
> Maybe LOW?  Either way,

Picked AUTO as that maps with AMDGPU_CTX_STABLE_PSTATE_NONE.

Thanks,
Lijo

> Acked-by: Alex Deucher <alexander.deucher at amd.com>
> 
>> +
>>          mutex_lock(&adev->pm.mutex);
>>          if (pp_funcs->get_performance_level)
>>                  level = pp_funcs->get_performance_level(adev->powerplay.pp_handle);
>> --
>> 2.25.1
>>


More information about the amd-gfx mailing list