]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/amdgpu: Update debugfs link_settings output link_rate field in hex
authorAnson Jacob <Anson.Jacob@amd.com>
Tue, 20 Jul 2021 15:00:44 +0000 (11:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Jul 2021 14:08:00 +0000 (10:08 -0400)
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>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

index f1145086a46882c9ae4ba693cfd1e59393d433de..1d15a9af99560e1453c4c3bf64c97dda8cdaee26 100644 (file)
@@ -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);