* [PATCH] drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex
@ 2021-07-20 15:25 Anson Jacob
2021-07-20 20:51 ` Harry Wentland
0 siblings, 1 reply; 2+ messages in thread
From: Anson Jacob @ 2021-07-20 15:25 UTC (permalink / raw)
To: amd-gfx
Cc: stylon.wang, sunpeng.li, nirmoy.das, Nicholas.Kazlauskas,
Anson Jacob, aurabindo.pillai, hersenxs.wu, Wayne.Lin,
mikita.lipski, harry.wentland, christian.koenig
link_rate is updated via debugfs using hex values, set it to output
in hex as well.
eg: Resolution: 1920x1080@144Hz
cat /sys/kernel/debug/dri/0/DP-1/link_settings
Current: 4 0x14 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 0 0x0 0
echo "4 0x1e" > /sys/kernel/debug/dri/0/DP-1/link_settings
cat /sys/kernel/debug/dri/0/DP-1/link_settings
Current: 4 0x1e 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 4 0x1e 0
Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index f1145086a468..1d15a9af9956 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -197,29 +197,29 @@ static ssize_t dp_link_settings_read(struct file *f, char __user *buf,
rd_buf_ptr = rd_buf;
- str_len = strlen("Current: %d %d %d ");
- snprintf(rd_buf_ptr, str_len, "Current: %d %d %d ",
+ str_len = strlen("Current: %d 0x%x %d ");
+ snprintf(rd_buf_ptr, str_len, "Current: %d 0x%x %d ",
link->cur_link_settings.lane_count,
link->cur_link_settings.link_rate,
link->cur_link_settings.link_spread);
rd_buf_ptr += str_len;
- str_len = strlen("Verified: %d %d %d ");
- snprintf(rd_buf_ptr, str_len, "Verified: %d %d %d ",
+ str_len = strlen("Verified: %d 0x%x %d ");
+ snprintf(rd_buf_ptr, str_len, "Verified: %d 0x%x %d ",
link->verified_link_cap.lane_count,
link->verified_link_cap.link_rate,
link->verified_link_cap.link_spread);
rd_buf_ptr += str_len;
- str_len = strlen("Reported: %d %d %d ");
- snprintf(rd_buf_ptr, str_len, "Reported: %d %d %d ",
+ str_len = strlen("Reported: %d 0x%x %d ");
+ snprintf(rd_buf_ptr, str_len, "Reported: %d 0x%x %d ",
link->reported_link_cap.lane_count,
link->reported_link_cap.link_rate,
link->reported_link_cap.link_spread);
rd_buf_ptr += str_len;
- str_len = strlen("Preferred: %d %d %d ");
- snprintf(rd_buf_ptr, str_len, "Preferred: %d %d %d\n",
+ str_len = strlen("Preferred: %d 0x%x %d ");
+ snprintf(rd_buf_ptr, str_len, "Preferred: %d 0x%x %d\n",
link->preferred_link_setting.lane_count,
link->preferred_link_setting.link_rate,
link->preferred_link_setting.link_spread);
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex
2021-07-20 15:25 [PATCH] drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex Anson Jacob
@ 2021-07-20 20:51 ` Harry Wentland
0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2021-07-20 20:51 UTC (permalink / raw)
To: Anson Jacob, amd-gfx
Cc: stylon.wang, sunpeng.li, nirmoy.das, Nicholas.Kazlauskas,
aurabindo.pillai, hersenxs.wu, Wayne.Lin, mikita.lipski,
christian.koenig
On 2021-07-20 11:25 a.m., Anson Jacob wrote:
> link_rate is updated via debugfs using hex values, set it to output
> in hex as well.
>
> eg: Resolution: 1920x1080@144Hz
> cat /sys/kernel/debug/dri/0/DP-1/link_settings
> Current: 4 0x14 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 0 0x0 0
>
> echo "4 0x1e" > /sys/kernel/debug/dri/0/DP-1/link_settings
>
> cat /sys/kernel/debug/dri/0/DP-1/link_settings
> Current: 4 0x1e 0 Verified: 4 0x1e 0 Reported: 4 0x1e 16 Preferred: 4 0x1e 0
>
> Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
It probably makes sense to use hex for link_spread as well.
Either way
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index f1145086a468..1d15a9af9956 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -197,29 +197,29 @@ static ssize_t dp_link_settings_read(struct file *f, char __user *buf,
>
> rd_buf_ptr = rd_buf;
>
> - str_len = strlen("Current: %d %d %d ");
> - snprintf(rd_buf_ptr, str_len, "Current: %d %d %d ",
> + str_len = strlen("Current: %d 0x%x %d ");
> + snprintf(rd_buf_ptr, str_len, "Current: %d 0x%x %d ",
> link->cur_link_settings.lane_count,
> link->cur_link_settings.link_rate,
> link->cur_link_settings.link_spread);
> rd_buf_ptr += str_len;
>
> - str_len = strlen("Verified: %d %d %d ");
> - snprintf(rd_buf_ptr, str_len, "Verified: %d %d %d ",
> + str_len = strlen("Verified: %d 0x%x %d ");
> + snprintf(rd_buf_ptr, str_len, "Verified: %d 0x%x %d ",
> link->verified_link_cap.lane_count,
> link->verified_link_cap.link_rate,
> link->verified_link_cap.link_spread);
> rd_buf_ptr += str_len;
>
> - str_len = strlen("Reported: %d %d %d ");
> - snprintf(rd_buf_ptr, str_len, "Reported: %d %d %d ",
> + str_len = strlen("Reported: %d 0x%x %d ");
> + snprintf(rd_buf_ptr, str_len, "Reported: %d 0x%x %d ",
> link->reported_link_cap.lane_count,
> link->reported_link_cap.link_rate,
> link->reported_link_cap.link_spread);
> rd_buf_ptr += str_len;
>
> - str_len = strlen("Preferred: %d %d %d ");
> - snprintf(rd_buf_ptr, str_len, "Preferred: %d %d %d\n",
> + str_len = strlen("Preferred: %d 0x%x %d ");
> + snprintf(rd_buf_ptr, str_len, "Preferred: %d 0x%x %d\n",
> link->preferred_link_setting.lane_count,
> link->preferred_link_setting.link_rate,
> link->preferred_link_setting.link_spread);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-20 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 15:25 [PATCH] drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex Anson Jacob
2021-07-20 20:51 ` Harry Wentland
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.