Commit 9985318b authored by Alex Deucher's avatar Alex Deucher

drm/radeon/dpm: endian fixes for extended power tables

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 929ee7a8
...@@ -786,7 +786,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) ...@@ -786,7 +786,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev)
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
/* fan table */ /* fan table */
if (power_info->pplib.usTableSize >= sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE3)) { if (le16_to_cpu(power_info->pplib.usTableSize) >=
sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE3)) {
if (power_info->pplib3.usFanTableOffset) { if (power_info->pplib3.usFanTableOffset) {
fan_info = (union fan_info *)(mode_info->atom_context->bios + data_offset + fan_info = (union fan_info *)(mode_info->atom_context->bios + data_offset +
le16_to_cpu(power_info->pplib3.usFanTableOffset)); le16_to_cpu(power_info->pplib3.usFanTableOffset));
...@@ -807,7 +808,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) ...@@ -807,7 +808,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev)
} }
/* clock dependancy tables, shedding tables */ /* clock dependancy tables, shedding tables */
if (power_info->pplib.usTableSize >= sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE4)) { if (le16_to_cpu(power_info->pplib.usTableSize) >=
sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE4)) {
if (power_info->pplib4.usVddcDependencyOnSCLKOffset) { if (power_info->pplib4.usVddcDependencyOnSCLKOffset) {
dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *) dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *)
(mode_info->atom_context->bios + data_offset + (mode_info->atom_context->bios + data_offset +
...@@ -887,7 +889,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) ...@@ -887,7 +889,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev)
} }
/* cac data */ /* cac data */
if (power_info->pplib.usTableSize >= sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE5)) { if (le16_to_cpu(power_info->pplib.usTableSize) >=
sizeof(struct _ATOM_PPLIB_POWERPLAYTABLE5)) {
rdev->pm.dpm.tdp_limit = le32_to_cpu(power_info->pplib5.ulTDPLimit); rdev->pm.dpm.tdp_limit = le32_to_cpu(power_info->pplib5.ulTDPLimit);
rdev->pm.dpm.near_tdp_limit = le32_to_cpu(power_info->pplib5.ulNearTDPLimit); rdev->pm.dpm.near_tdp_limit = le32_to_cpu(power_info->pplib5.ulNearTDPLimit);
rdev->pm.dpm.tdp_od_limit = le16_to_cpu(power_info->pplib5.usTDPODLimit); rdev->pm.dpm.tdp_od_limit = le16_to_cpu(power_info->pplib5.usTDPODLimit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment