[PATCH] drm/amdgpu/pp: add missing byte swapping in process_pptables_v1_0.c

Zhu, Rex Rex.Zhu at amd.com
Fri Jun 29 00:22:04 UTC 2018


Reviewed-by: Rex Zhu <Rex.Zhu at amd.com>



Best Regards

Rex



________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher at gmail.com>
Sent: Friday, June 29, 2018 2:38 AM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander
Subject: [PATCH] drm/amdgpu/pp: add missing byte swapping in process_pptables_v1_0.c

Values need to be swapped on big endian.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
index 35bd9870ab10..4e1fd5393845 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
@@ -183,10 +183,10 @@ static int get_vddc_lookup_table(
                                         ATOM_Tonga_Voltage_Lookup_Record,
                                         entries, vddc_lookup_pp_tables, i);
                 record->us_calculated = 0;
-               record->us_vdd = atom_record->usVdd;
-               record->us_cac_low = atom_record->usCACLow;
-               record->us_cac_mid = atom_record->usCACMid;
-               record->us_cac_high = atom_record->usCACHigh;
+               record->us_vdd = le16_to_cpu(atom_record->usVdd);
+               record->us_cac_low = le16_to_cpu(atom_record->usCACLow);
+               record->us_cac_mid = le16_to_cpu(atom_record->usCACMid);
+               record->us_cac_high = le16_to_cpu(atom_record->usCACHigh);
         }

         *lookup_table = table;
--
2.13.6

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180629/57de5d4b/attachment.html>


More information about the amd-gfx mailing list