From: Harry Wentland <harry.wentland@amd.com>
To: Anson Jacob <Anson.Jacob@amd.com>, amd-gfx@lists.freedesktop.org
Cc: stylon.wang@amd.com, sunpeng.li@amd.com, nirmoy.das@amd.com,
Nicholas.Kazlauskas@amd.com, aurabindo.pillai@amd.com,
hersenxs.wu@amd.com, Wayne.Lin@amd.com, mikita.lipski@amd.com,
christian.koenig@amd.com
Subject: Re: [PATCH] drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex
Date: Tue, 20 Jul 2021 16:51:56 -0400 [thread overview]
Message-ID: <573b3bdf-a388-d826-f035-1a163bb031d8@amd.com> (raw)
In-Reply-To: <20210720152546.654510-1-Anson.Jacob@amd.com>
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
prev parent reply other threads:[~2021-07-20 20:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=573b3bdf-a388-d826-f035-1a163bb031d8@amd.com \
--to=harry.wentland@amd.com \
--cc=Anson.Jacob@amd.com \
--cc=Nicholas.Kazlauskas@amd.com \
--cc=Wayne.Lin@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=christian.koenig@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=mikita.lipski@amd.com \
--cc=nirmoy.das@amd.com \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.