<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>This reading method is shared with AGT tool only on Fiji, because
      SMU FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji.
      But since polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported.
      We also use PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control
      sampling period. Driver will not care about it.</p>
    <p><br>
    </p>
    <p>Eric<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2018-03-29 03:31 PM, Deucher,
      Alexander wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BN6PR12MB18093357508F0377D97DCBFCF7A20@BN6PR12MB1809.namprd12.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
        dir="ltr">
        <p style="margin-top:0;margin-bottom:0">Do you know what the
          sampling period is on vega?  We should try and be consistent. 
          How about making this selectable via hwmon:</p>
        <pre>power[1-*]_average_interval  Power use averaging interval.  A poll
                                notification is sent to this file if the
                                hardware changes the averaging interval.
                                Unit: milliseconds
                                RW

power[1-*]_average_interval_max Maximum power use averaging interval
                                Unit: milliseconds
                                RO

power[1-*]_average_interval_min Minimum power use averaging interval
                                Unit: milliseconds
                                RO</pre>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">Then the user can select
          the interval they want.<br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">Alex<br>
        </p>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b>
          amd-gfx <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx-bounces@lists.freedesktop.org"><amd-gfx-bounces@lists.freedesktop.org></a> on
          behalf of Eric Huang <a class="moz-txt-link-rfc2396E" href="mailto:JinHuiEric.Huang@amd.com"><JinHuiEric.Huang@amd.com></a><br>
          <b>Sent:</b> Thursday, March 29, 2018 3:21:52 PM<br>
          <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
          <b>Cc:</b> Huang, JinHuiEric<br>
          <b>Subject:</b> [PATCH] drm/amd/powerply: fix power reading on
          Fiji</font>
        <div> </div>
      </div>
      <div class="BodyFragment"><font size="2"><span
            style="font-size:11pt;">
            <div class="PlainText">Power value is wrong reported by
              customer. It is a regression by<br>
              <br>
              commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254<br>
              Author: Rex Zhu <a class="moz-txt-link-rfc2396E" href="mailto:Rex.Zhu@amd.com"><Rex.Zhu@amd.com></a><br>
              Date:   Mon Mar 27 15:32:59 2017 +0800<br>
              <br>
                  drm/amd/powerplay: reduce sample period time<br>
              <br>
                  for power readings.<br>
              <br>
                  Signed-off-by: Rex Zhu <a class="moz-txt-link-rfc2396E" href="mailto:Rex.Zhu@amd.com"><Rex.Zhu@amd.com></a><br>
                  Reviewed-by: Alex Deucher
              <a class="moz-txt-link-rfc2396E" href="mailto:alexander.deucher@amd.com"><alexander.deucher@amd.com></a><br>
                  Signed-off-by: Alex Deucher
              <a class="moz-txt-link-rfc2396E" href="mailto:alexander.deucher@amd.com"><alexander.deucher@amd.com></a><br>
              <br>
              The theoretical sampling period is from 50ms to 4sec,
              original 2sec<br>
              is long but correct, and 20ms is too short. change it to
              more<br>
              reasonable 200ms.<br>
              <br>
              Signed-off-by: Eric Huang <a class="moz-txt-link-rfc2396E" href="mailto:JinHuiEric.Huang@amd.com"><JinHuiEric.Huang@amd.com></a><br>
              ---<br>
               drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-<br>
               1 file changed, 2 insertions(+), 1 deletion(-)<br>
              <br>
              diff --git
              a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
              b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
              index a03b7fe..7631d80 100644<br>
              --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
              +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
              @@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct
              pp_hwmgr *hwmgr,<br>
                                       "Failed to start pm status log!",<br>
                                       return -1);<br>
               <br>
              -       msleep_interruptible(20);<br>
              +       /* Sampling period from 50ms to 4sec */<br>
              +       msleep_interruptible(200);<br>
               <br>
                       PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,<br>
                                       PPSMC_MSG_PmStatusLogSample),<br>
              -- <br>
              2.7.4<br>
              <br>
              _______________________________________________<br>
              amd-gfx mailing list<br>
              <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
              <a
                href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx"
                moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
            </div>
          </span></font></div>
    </blockquote>
    <br>
  </body>
</html>