aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-06-24 10:54:16 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-06-27 19:40:15 -0400
commit6e764764d54e05efe04b9eff490dadf662ae44b4 (patch)
tree63a4b09cc23ca9400fc460edf1f30fda1f00fc01
parente34568b89233004f1679cc801859a00b48c6163d (diff)
drm/radeon: fix endian issues in atombios dpm code
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5d798c9176e7..a8296e0f8543 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -3127,7 +3127,7 @@ union voltage_object {
3127static ATOM_VOLTAGE_OBJECT *atom_lookup_voltage_object_v1(ATOM_VOLTAGE_OBJECT_INFO *v1, 3127static ATOM_VOLTAGE_OBJECT *atom_lookup_voltage_object_v1(ATOM_VOLTAGE_OBJECT_INFO *v1,
3128 u8 voltage_type) 3128 u8 voltage_type)
3129{ 3129{
3130 u32 size = v1->sHeader.usStructureSize; 3130 u32 size = le16_to_cpu(v1->sHeader.usStructureSize);
3131 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO, asVoltageObj[0]); 3131 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO, asVoltageObj[0]);
3132 u8 *start = (u8 *)v1; 3132 u8 *start = (u8 *)v1;
3133 3133
@@ -3144,7 +3144,7 @@ static ATOM_VOLTAGE_OBJECT *atom_lookup_voltage_object_v1(ATOM_VOLTAGE_OBJECT_IN
3144static ATOM_VOLTAGE_OBJECT_V2 *atom_lookup_voltage_object_v2(ATOM_VOLTAGE_OBJECT_INFO_V2 *v2, 3144static ATOM_VOLTAGE_OBJECT_V2 *atom_lookup_voltage_object_v2(ATOM_VOLTAGE_OBJECT_INFO_V2 *v2,
3145 u8 voltage_type) 3145 u8 voltage_type)
3146{ 3146{
3147 u32 size = v2->sHeader.usStructureSize; 3147 u32 size = le16_to_cpu(v2->sHeader.usStructureSize);
3148 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO_V2, asVoltageObj[0]); 3148 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO_V2, asVoltageObj[0]);
3149 u8 *start = (u8*)v2; 3149 u8 *start = (u8*)v2;
3150 3150
@@ -3161,7 +3161,7 @@ static ATOM_VOLTAGE_OBJECT_V2 *atom_lookup_voltage_object_v2(ATOM_VOLTAGE_OBJECT
3161static ATOM_VOLTAGE_OBJECT_V3 *atom_lookup_voltage_object_v3(ATOM_VOLTAGE_OBJECT_INFO_V3_1 *v3, 3161static ATOM_VOLTAGE_OBJECT_V3 *atom_lookup_voltage_object_v3(ATOM_VOLTAGE_OBJECT_INFO_V3_1 *v3,
3162 u8 voltage_type, u8 voltage_mode) 3162 u8 voltage_type, u8 voltage_mode)
3163{ 3163{
3164 u32 size = v3->sHeader.usStructureSize; 3164 u32 size = le16_to_cpu(v3->sHeader.usStructureSize);
3165 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO_V3_1, asVoltageObj[0]); 3165 u32 offset = offsetof(ATOM_VOLTAGE_OBJECT_INFO_V3_1, asVoltageObj[0]);
3166 u8 *start = (u8*)v3; 3166 u8 *start = (u8*)v3;
3167 3167
@@ -3170,7 +3170,7 @@ static ATOM_VOLTAGE_OBJECT_V3 *atom_lookup_voltage_object_v3(ATOM_VOLTAGE_OBJECT
3170 if ((vo->asGpioVoltageObj.sHeader.ucVoltageType == voltage_type) && 3170 if ((vo->asGpioVoltageObj.sHeader.ucVoltageType == voltage_type) &&
3171 (vo->asGpioVoltageObj.sHeader.ucVoltageMode == voltage_mode)) 3171 (vo->asGpioVoltageObj.sHeader.ucVoltageMode == voltage_mode))
3172 return vo; 3172 return vo;
3173 offset += vo->asGpioVoltageObj.sHeader.usSize; 3173 offset += le16_to_cpu(vo->asGpioVoltageObj.sHeader.usSize);
3174 } 3174 }
3175 return NULL; 3175 return NULL;
3176} 3176}
@@ -3708,7 +3708,7 @@ int radeon_atom_init_mc_reg_table(struct radeon_device *rdev,
3708 while (!(reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER) && 3708 while (!(reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER) &&
3709 (i < num_entries)) { 3709 (i < num_entries)) {
3710 reg_table->mc_reg_address[i].s1 = 3710 reg_table->mc_reg_address[i].s1 =
3711 (u16)(reg_block->asRegIndexBuf[i].usRegIndex); 3711 (u16)(le16_to_cpu(reg_block->asRegIndexBuf[i].usRegIndex));
3712 reg_table->mc_reg_address[i].pre_reg_data = 3712 reg_table->mc_reg_address[i].pre_reg_data =
3713 (u8)(reg_block->asRegIndexBuf[i].ucPreRegDataLength); 3713 (u8)(reg_block->asRegIndexBuf[i].ucPreRegDataLength);
3714 i++; 3714 i++;