[PATCH 1/2] drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/ST

Deucher, Alexander Alexander.Deucher at amd.com
Wed Jul 25 14:45:38 UTC 2018


Acked-by: Alex Deucher <alexander.deucher at amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Rex Zhu <rex.zhu at amd.com>
Sent: Wednesday, July 25, 2018 1:03:12 AM
To: amd-gfx at lists.freedesktop.org
Cc: Zhu, Rex
Subject: [PATCH 1/2] drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/ST

the voltage showed in debugfs and hwmon should be in mV

Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
index cafa822..b863704 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
@@ -244,6 +244,7 @@ static int smu8_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)
         return 0;
 }

+/* convert form 8bit vid to real voltage in mV*4 */
 static uint32_t smu8_convert_8Bit_index_to_voltage(
                         struct pp_hwmgr *hwmgr, uint16_t voltage)
 {
@@ -1707,13 +1708,13 @@ static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,
         case AMDGPU_PP_SENSOR_VDDNB:
                 tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_NB_CURRENTVID) &
                         CURRENT_NB_VID_MASK) >> CURRENT_NB_VID__SHIFT;
-               vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp);
+               vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp) / 4;
                 *((uint32_t *)value) = vddnb;
                 return 0;
         case AMDGPU_PP_SENSOR_VDDGFX:
                 tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_GFX_CURRENTVID) &
                         CURRENT_GFX_VID_MASK) >> CURRENT_GFX_VID__SHIFT;
-               vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp);
+               vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp) / 4;
                 *((uint32_t *)value) = vddgfx;
                 return 0;
         case AMDGPU_PP_SENSOR_UVD_VCLK:
--
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180725/71d3a355/attachment-0001.html>


More information about the amd-gfx mailing list