Re: [PATCH 2/2] drm/amd/powerplay: expose Vega12 current gpu activity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 18, 2019 at 5:04 AM Evan Quan <evan.quan@xxxxxxx> wrote:
>
> Provide the real sensor information for current gpu activity.
>
> Change-Id: I8449672a6fdabb4287e12e36a4f95e08e2d65e47
> Signed-off-by: Evan Quan <evan.quan@xxxxxxx>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c    | 21 ++++++-------------
>  1 file changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> index ad63372d9d0c..6f4bd15421e5 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> @@ -1310,23 +1310,14 @@ static int vega12_get_current_activity_percent(
>                 struct pp_hwmgr *hwmgr,
>                 uint32_t *activity_percent)
>  {
> +       SmuMetrics_t metrics_table;
>         int ret = 0;
> -       uint32_t current_activity = 50;
>
> -#if 0
> -       ret = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetAverageGfxActivity, 0);
> -       if (!ret) {
> -               current_activity = smum_get_argument(hwmgr);
> -               if (current_activity > 100) {
> -                       PP_ASSERT(false,
> -                                 "[GetCurrentActivityPercent] Activity Percentage Exceeds 100!");
> -                       current_activity = 100;
> -               }
> -       } else
> -               PP_ASSERT(false,
> -                       "[GetCurrentActivityPercent] Attempt To Send Get Average Graphics Activity to SMU Failed!");
> -#endif
> -       *activity_percent = current_activity;
> +       ret = vega12_get_metrics_table(hwmgr, &metrics_table);
> +       if (ret)
> +               return ret;
> +
> +       *activity_percent = metrics_table.AverageGfxActivity;
>
>         return ret;
>  }
> --
> 2.21.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux