<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<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">Should the comment then say 'get the load' instead of 'get the temperature'?</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> StDenis, Tom<br>
<b>Sent:</b> Wednesday, June 20, 2018 10:39:25 AM<br>
<b>To:</b> Abramov, Slava; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 06/20/2018 10:37 AM, Abramov, Slava wrote:<br>
> I see some functions in amdgpu_pm.c have function level documentation, <br>
> so that it would be good to have this for newly added functions.<br>
<br>
Sure I can add some comments/docs.<br>
<br>
> Another comment is inline.<br>
> <br>
> <br>
>>From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Tom St Denis <tom.stdenis@amd.com><br>
> <br>
> >Sent: Wednesday, June 20, 2018 8:31 AM<br>
> >To: amd-gfx@lists.freedesktop.org<br>
> >Cc: StDenis, Tom<br>
> >Subject: [PATCH] drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs<br>
> ><br>
> >This adds what should be a stable interface to read GPU<br>
> >load from userspace.<br>
> ><br>
> >Signed-off-by: Tom St Denis <tom.stdenis@amd.com><br>
> >---<br>
> > drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 41 <br>
> ++++++++++++++++++++++++++++++++++<br>
> > 1 file changed, 41 insertions(+)<br>
> ><br>
> >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c <br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> >index 113edffb5960..d57b414ac228 100644<br>
> >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> >@@ -918,6 +918,37 @@ static ssize_t <br>
> amdgpu_set_pp_power_profile_mode(struct device *dev,<br>
> > return -EINVAL;<br>
> > }<br>
> ><br>
> >+static ssize_t amdgpu_get_busy_level(struct device *dev,<br>
> >+ struct device_attribute *attr,<br>
> >+ char *buf)<br>
> >+{<br>
> >+ struct drm_device *ddev = dev_get_drvdata(dev);<br>
> >+ struct amdgpu_device *adev = ddev->dev_private;<br>
> >+ int r, value, size = sizeof(value);<br>
> >+<br>
> >+ /* sanity check PP is enabled */<br>
> >+ if (!(adev->powerplay.pp_funcs &&<br>
> >+ adev->powerplay.pp_funcs->read_sensor))<br>
> >+ return -EINVAL;<br>
> >+<br>
> >+ /* get the temperature */<br>
> <br>
> Is load is the same thing as temperature?<br>
<br>
<br>
Nope, there is a separate sensor for that but it is included in hwmon <br>
and Alex would rather not duplicate it.<br>
<br>
GPU_LOAD is a value returned by firmware based on the RLC busy status (I <br>
think...).<br>
<br>
Tom<br>
</div>
</span></font></div>
</body>
</html>