All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Return auto perf level, if unsupported
@ 2022-05-24 12:36 Lijo Lazar
  2022-05-24 13:19 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Lijo Lazar @ 2022-05-24 12:36 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Hawking.Zhang

When powerplay is not enabled, return AUTO as default level.

Signed-off-by: Lijo Lazar <lijo.lazar@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;
+
 	mutex_lock(&adev->pm.mutex);
 	if (pp_funcs->get_performance_level)
 		level = pp_funcs->get_performance_level(adev->powerplay.pp_handle);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/pm: Return auto perf level, if unsupported
  2022-05-24 12:36 [PATCH] drm/amd/pm: Return auto perf level, if unsupported Lijo Lazar
@ 2022-05-24 13:19 ` Alex Deucher
  2022-05-24 13:25   ` Lazar, Lijo
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2022-05-24 13:19 UTC (permalink / raw)
  To: Lijo Lazar; +Cc: Deucher, Alexander, amd-gfx list, Hawking Zhang

On Tue, May 24, 2022 at 8:36 AM Lijo Lazar <lijo.lazar@amd.com> wrote:
>
> When powerplay is not enabled, return AUTO as default level.
>
> Signed-off-by: Lijo Lazar <lijo.lazar@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,
Acked-by: Alex Deucher <alexander.deucher@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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/pm: Return auto perf level, if unsupported
  2022-05-24 13:19 ` Alex Deucher
@ 2022-05-24 13:25   ` Lazar, Lijo
  0 siblings, 0 replies; 3+ messages in thread
From: Lazar, Lijo @ 2022-05-24 13:25 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Deucher, Alexander, amd-gfx list, Hawking Zhang



On 5/24/2022 6:49 PM, Alex Deucher wrote:
> On Tue, May 24, 2022 at 8:36 AM Lijo Lazar <lijo.lazar@amd.com> wrote:
>>
>> When powerplay is not enabled, return AUTO as default level.
>>
>> Signed-off-by: Lijo Lazar <lijo.lazar@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@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
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-24 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 12:36 [PATCH] drm/amd/pm: Return auto perf level, if unsupported Lijo Lazar
2022-05-24 13:19 ` Alex Deucher
2022-05-24 13:25   ` Lazar, Lijo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.