[PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

Russell, Kent Kent.Russell at amd.com
Tue Mar 26 09:47:31 UTC 2019


Indeed, it allowed me to apply the profile even with no previous profile set (so it basically just applied all zeros). I’ll rebase my 2 patches on your patch once that is pushed to drm-next.

Kent

From: Quan, Evan
Sent: Tuesday, March 26, 2019 5:10 AM
To: Russell, Kent <Kent.Russell at amd.com>; amd-gfx at lists.freedesktop.org
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

That seems a bug. I will fix that.
It’s OK to store previous CUSTOM profile settings in driver and switch back to that with no need to pass in settings again. That makes sense.
But you may need to update the patch(to check whether there is previous custom profile settings).

Regards,
Evan
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org<mailto:amd-gfx-bounces at lists.freedesktop.org>> On Behalf Of Russell, Kent
Sent: 2019年3月26日 0:00
To: Quan, Evan <Evan.Quan at amd.com<mailto:Evan.Quan at amd.com>>; amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
Subject: Re: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

I set CUSTOM to a weird value like "1 2 3 4 5 6" , then switched to VR profile, then switched back to CUSTOM (just with "echo 6 > profile), and it kept my custom values. Before this patch, it throws EINVAL but still switches it to CUSTOM with the saved values, on both vega10 and vega20.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: Quan, Evan
Sent: Monday, March 25, 2019 10:14:03 AM
To: Russell, Kent; amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
Cc: Russell, Kent
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

How can you tell whether it was already applied before or 1st time to switch to compute mode?
For the latter case, other settings/parameters do need.

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org<mailto:amd-gfx-bounces at lists.freedesktop.org>> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
> Cc: Russell, Kent <Kent.Russell at amd.com<mailto:Kent.Russell at amd.com>>
> Subject: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile
> switch
>
> Don't return an error after switching to the CUSTOM profile, if there aren't
> any CUSTOM values passed in. The CUSTOM profile is already applied, so if
> no other arguments are passed, just return instead of throwing -EINVAL
> when successful
>
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
> Signed-off-by: Kent Russell <kent.russell at amd.com<mailto:kent.russell at amd.com>>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ed6c638700f5..a98b927282ac 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>                                                1<<hwmgr-
> >power_profile_mode);
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size == 0 || size > 4)
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
> +
> +             if (size != 4)
>                        return -EINVAL;
>
>                data->custom_profile_mode[0] = busy_set_point = input[0];
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> index 664544e7fcdc..225b2102c82c 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> @@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>        }
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size < 10)
> +             if (size < 10 && size != 0)
>                        return -EINVAL;
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
>
>                result = vega20_get_activity_monitor_coeff(hwmgr,
>                                (uint8_t *)(&activity_monitor),
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190326/702c257c/attachment-0001.html>


More information about the amd-gfx mailing list