diff options
| author | Perry Yuan <perry.yuan@amd.com> | 2026-02-09 00:42:06 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-05-11 15:55:56 -0400 |
| commit | d51a0439358d4eacd8beb39df619998d8340d232 (patch) | |
| tree | d28382b021fecb61d945cfb1895467afbd2ea532 /drivers/gpu/drm/amd/include | |
| parent | aa86e750d0ff79c179772b9d3a95375c02a7d191 (diff) | |
drm/amdgpu: add sysfs for Peak Tops Limiter (PTL)
Add per-GPU sysfs files under /sys/class/drm/cardX/device/ptl to
control the Peak Tops Limiter (PTL) feature. Exposes ptl_enable
(enable/disable PTL), ptl_format (set/query preferred formats),
and ptl_supported_formats (list supported formats)
Example usage
-------------
Query PTL status:
`cat /sys/class/drm/card1/device/ptl/ptl_enable`
Enable PTL:
`sudo bash -c "echo 1 > /sys/class/drm/card1/device/ptl/ptl_enable"`
Disable PTL:
`sudo bash -c "echo 0 > /sys/class/drm/card1/device/ptl/ptl_enable"`
Set PTL preferred formats:
`sudo bash -c "echo I8,F32 > /sys/class/drm/card1/device/ptl/ptl_format"`
Query supported formats:
`cat /sys/class/drm/card1/device/ptl/ptl_supported_formats`
v3 changes:
* move N/A to previous format in format show(Alex)
* fix format check for format store(Alex)
* drop the ptl declarations into amdgpu_ptl.h(Alex)
v2 changes:
* add usage commands in commit info (Alex)
* move amdgpu_ptl_fmt into kgd_kfd_interface.h (Alex)
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/include')
| -rw-r--r-- | drivers/gpu/drm/amd/include/amdgpu_ptl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/include/amdgpu_ptl.h b/drivers/gpu/drm/amd/include/amdgpu_ptl.h index 17e803f4caf8..ffed443a14ae 100644 --- a/drivers/gpu/drm/amd/include/amdgpu_ptl.h +++ b/drivers/gpu/drm/amd/include/amdgpu_ptl.h @@ -47,4 +47,8 @@ int amdgpu_ptl_perf_monitor_ctrl(struct amdgpu_device *adev, u32 req_code, enum amdgpu_ptl_fmt *fmt1, enum amdgpu_ptl_fmt *fmt2); +int amdgpu_ptl_sysfs_init(struct amdgpu_device *adev); +void amdgpu_ptl_sysfs_fini(struct amdgpu_device *adev); + +extern const struct attribute_group amdgpu_ptl_attr_group; #endif /* __AMDGPU_PTL_H__ */ |
