[PATCH] drm/amdgpu: Fix check for DPM when returning max clock

Alex Deucher alexdeucher at gmail.com
Tue Feb 25 20:35:23 UTC 2020


On Tue, Feb 25, 2020 at 3:20 PM Kent Russell <kent.russell at amd.com> wrote:
>
> pp_funcs may not exist, while dpm may be enabled. This change ensures
> that KFD topology will report the same as pp_dpm_sclk, as the conditions
> for reporting them will be the same.
>
> Otherwise, we may see the issue where KFD reports "100MHz" in topology
> as the max speed, while DPM is working correctly.
>
> Change-Id: I967988e936de5371c22bf92895bda22324d9631b
> Signed-off-by: Kent Russell <kent.russell at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index e1c2c182898f..7e8276651865 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -402,7 +402,7 @@ void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,
>
>         if (amdgpu_sriov_vf(adev))
>                 mem_info->mem_clk_max = adev->clock.default_mclk / 100;
> -       else if (adev->powerplay.pp_funcs) {
> +       else if (adev->pm.dpm_enabled) {
>                 if (amdgpu_emu_mode == 1)
>                         mem_info->mem_clk_max = 0;
>                 else
> @@ -427,7 +427,7 @@ uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd)
>         /* the sclk is in quantas of 10kHz */
>         if (amdgpu_sriov_vf(adev))
>                 return adev->clock.default_sclk / 100;
> -       else if (adev->powerplay.pp_funcs)
> +       else if (adev->pm.dpm_enabled)
>                 return amdgpu_dpm_get_sclk(adev, false) / 100;
>         else
>                 return 100;
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list