[PATCH] drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs

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

 



I see some functions in amdgpu_pm.c have function level documentation, so that it would be good to have this for newly added functions.


Another comment is inline.


>From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Tom St Denis <tom.stdenis at amd.com>

>Sent: Wednesday, June 20, 2018 8:31 AM
>To: amd-gfx at lists.freedesktop.org
>Cc: StDenis, Tom
>Subject: [PATCH] drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs
>
>This adds what should be a stable interface to read GPU
>load from userspace.
>
>Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
>---
> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 41 ++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
>index 113edffb5960..d57b414ac228 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
>@@ -918,6 +918,37 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
>         return -EINVAL;
> }
>
>+static ssize_t amdgpu_get_busy_level(struct device *dev,
>+               struct device_attribute *attr,
>+               char *buf)
>+{
>+       struct drm_device *ddev = dev_get_drvdata(dev);
>+       struct amdgpu_device *adev = ddev->dev_private;
>+       int r, value, size = sizeof(value);
>+
>+       /* sanity check PP is enabled */
>+       if (!(adev->powerplay.pp_funcs &&
>+             adev->powerplay.pp_funcs->read_sensor))
>+               return -EINVAL;
>+
>+       /* get the temperature */

Is load is the same thing as temperature?

[snap]


Slava A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180620/d2399d1a/attachment-0001.html>


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

  Powered by Linux