diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-03-20 17:44:11 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-06-28 01:16:34 +0200 |
commit | 9985318b7f9960c08dec0d157fd1f86f6c066683 (patch) | |
tree | 9d5f1e10bf049d63e41e07d2ff6db64e0d1d59ee /drivers/gpu/drm/radeon/r600_dpm.c | |
parent | drm/radeon/dpm: pull in phase shedding limits from atom (diff) | |
download | linux-9985318b7f9960c08dec0d157fd1f86f6c066683.tar.xz linux-9985318b7f9960c08dec0d157fd1f86f6c066683.zip |
drm/radeon/dpm: endian fixes for extended power tables
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_dpm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_dpm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index a213d5a01ace..e220023f2cc1 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -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); /* 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) { fan_info = (union fan_info *)(mode_info->atom_context->bios + data_offset + le16_to_cpu(power_info->pplib3.usFanTableOffset)); @@ -807,7 +808,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) } /* 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) { dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *) (mode_info->atom_context->bios + data_offset + @@ -887,7 +889,8 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) } /* 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.near_tdp_limit = le32_to_cpu(power_info->pplib5.ulNearTDPLimit); rdev->pm.dpm.tdp_od_limit = le16_to_cpu(power_info->pplib5.usTDPODLimit); |