drm/amd/amdgpu: fix the GPU power print error in pm info
Subsystems (3)
PATCH 1/1 drm/amd/amdgpu: fix the GPU power print error in pm info
Print the digit of the fractional part individually to avoid carrying during display.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -2
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (average GPU)\n" , query >>8 , (query &0xff ) /10 , (query &0xff ) %10 ); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_INPUT_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (current GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (current GPU)\n" , query >>8 , (query &0xff ) /10 , (query &0xff ) %10 ); size =sizeof (value);seq_printf (m,"\n" );
Signature · 1 line
2.25.1
[AMD Official Use Only - General]
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 7:09 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>; Ma, Li <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
Print the digit of the fractional part individually to avoid carrying during display.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -1
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (average GPU)\n" , query >>8 , (query & +0xff ) /10 , (query &0xff ) %10 );
Would you pls elaborate on this with an example ? it looks to me it makes no difference here.
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (current GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%u%u W (current GPU)\n", query >> 8, (query &
+0xff) / 10, (query & 0xff) % 10);
Would you pls elaborate on this with an example? it looks to me it makes no difference here.
size = sizeof(value);
seq_printf(m, "\n");--
2.25.1
[AMD Official Use Only - General]
-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Tuesday, October 24, 2023 10:29 PM
To: Ma, Li <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 7:09 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>; Ma, Li <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
Print the digit of the fractional part individually to avoid carrying during display.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -1
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (average GPU)\n" , query >>8 , (query & +0xff ) /10 , (query &0xff ) %10 );
Would you pls elaborate on this with an example ? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (current GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%u%u W (current GPU)\n", query >> 8, (query &
+0xff) / 10, (query & 0xff) % 10);
Would you pls elaborate on this with an example? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(value);
seq_printf(m, "\n");--
2.25.1
[AMD Official Use Only - General]
I see your point. How about this one ?
drivers/gpu/drm/amd/pm/amdgpu_pm.c +1 -1
@@ -4290,7 +4290,7 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%02u W (average GPU)\n" , query >>8 , query &0xff ); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_INPUT_POWER , (void *)&query, &size))seq_printf (m,"\t%u.%u W (current GPU)\n" , query >>8 , query &0xff );
Best Regards,
Yifan
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 11:43 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Tuesday, October 24, 2023 10:29 PM
To: Ma, Li <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 7:09 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>; Ma, Li <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
Print the digit of the fractional part individually to avoid carrying during display.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -1
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (average GPU)\n" , query >>8 , (query & +0xff ) /10 , (query &0xff ) %10 );
Would you pls elaborate on this with an example ? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (current GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%u%u W (current GPU)\n", query >> 8, (query &
+0xff) / 10, (query & 0xff) % 10);
Would you pls elaborate on this with an example? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(value);
seq_printf(m, "\n");--
2.25.1
[AMD Official Use Only - General]
Hi Yifan,
Got it. This is the better modification.
I will resend patch.
Best Regards,
Ma,Li
-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Wednesday, October 25, 2023 9:26 AM
To: Ma, Li <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
I see your point. How about this one ?
drivers/gpu/drm/amd/pm/amdgpu_pm.c +1 -1
@@ -4290,7 +4290,7 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%02u W (average GPU)\n" , query >>8 , query &0xff ); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_INPUT_POWER , (void *)&query, &size))seq_printf (m,"\t%u.%u W (current GPU)\n" , query >>8 , query &0xff );
Best Regards,
Yifan
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 11:43 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Tuesday, October 24, 2023 10:29 PM
To: Ma, Li <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
[AMD Official Use Only - General]
-----Original Message-----
From: Ma, Li <[email protected]>
Sent: Tuesday, October 24, 2023 7:09 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Feng, Kenneth <[email protected]>; StDenis, Tom <[email protected]>; Ma, Li <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: fix the GPU power print error in pm info
Print the digit of the fractional part individually to avoid carrying during display.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -1
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *aseq_printf (m,"\t%u mV (VDDNB)\n" , value); size =sizeof (uint32_t );if (!amdgpu_dpm_read_sensor (adev,AMDGPU_PP_SENSOR_GPU_AVG_POWER , (void *)&query, &size)) -seq_printf (m,"\t%u.%u W (average GPU)\n" , query >>8 , query &0xff ); +seq_printf (m,"\t%u.%u%u W (average GPU)\n" , query >>8 , (query & +0xff ) /10 , (query &0xff ) %10 );
Would you pls elaborate on this with an example ? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (current GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%u%u W (current GPU)\n", query >> 8, (query &
+0xff) / 10, (query & 0xff) % 10);
Would you pls elaborate on this with an example? it looks to me it makes no difference here.
Li: If the range of (query&0xff) is [0x01,0x09], the origin output is x.1~x.9. However, it should be x.01~x.09 which is same as smu fw.
size = sizeof(value);
seq_printf(m, "\n");--
2.25.1