summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-04-20 13:05:18 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-05-08 12:06:33 -0400
commit3a7be25ef1b99b30581517ffad558d52226664c8 (patch)
treeae5b34c4fe6b1530988084ca47ccbfd69b69c48c
parentdd852a4044a97bf68ad64ad2c55b3ef258d7f732 (diff)
Endian fixes for object table
-rw-r--r--src/radeon_atombios.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index a657fac7..15921d64 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1761,17 +1761,17 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
ATOM_DISPLAY_OBJECT_PATH *path;
addr += path_size;
path = (ATOM_DISPLAY_OBJECT_PATH *)addr;
- path_size += path->usSize;
+ path_size += le16_to_cpu(path->usSize);
- if (device_support & path->usDeviceTag) {
+ if (device_support & le16_to_cpu(path->usDeviceTag)) {
uint8_t con_obj_id, con_obj_num, con_obj_type;
- con_obj_id = (path->usConnObjectId & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
- con_obj_num = (path->usConnObjectId & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
- con_obj_type = (path->usConnObjectId & OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
+ con_obj_id = (le16_to_cpu(path->usConnObjectId) & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
+ con_obj_num = (le16_to_cpu(path->usConnObjectId) & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
+ con_obj_type = (le16_to_cpu(path->usConnObjectId) & OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
- if ((path->usDeviceTag == ATOM_DEVICE_TV1_SUPPORT) ||
- (path->usDeviceTag == ATOM_DEVICE_TV2_SUPPORT)) {
+ if ((le16_to_cpu(path->usDeviceTag) == ATOM_DEVICE_TV1_SUPPORT) ||
+ (le16_to_cpu(path->usDeviceTag) == ATOM_DEVICE_TV2_SUPPORT)) {
if (!enable_tv) {
info->BiosConnector[i].valid = FALSE;
continue;
@@ -1779,7 +1779,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
}
/* don't support CV yet */
- if (path->usDeviceTag == ATOM_DEVICE_CV_SUPPORT) {
+ if (le16_to_cpu(path->usDeviceTag) == ATOM_DEVICE_CV_SUPPORT) {
info->BiosConnector[i].valid = FALSE;
continue;
}
@@ -1810,15 +1810,15 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
continue;
} else
info->BiosConnector[i].valid = TRUE;
- info->BiosConnector[i].devices = path->usDeviceTag;
- info->BiosConnector[i].connector_object = path->usConnObjectId;
+ info->BiosConnector[i].devices = le16_to_cpu(path->usDeviceTag);
+ info->BiosConnector[i].connector_object = le16_to_cpu(path->usConnObjectId);
- for (j = 0; j < ((path->usSize - 8) / 2); j++) {
+ for (j = 0; j < ((le16_to_cpu(path->usSize) - 8) / 2); j++) {
uint8_t enc_obj_id, enc_obj_num, enc_obj_type;
- enc_obj_id = (path->usGraphicObjIds[j] & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
- enc_obj_num = (path->usGraphicObjIds[j] & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
- enc_obj_type = (path->usGraphicObjIds[j] & OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
+ enc_obj_id = (le16_to_cpu(path->usGraphicObjIds[j]) & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
+ enc_obj_num = (le16_to_cpu(path->usGraphicObjIds[j]) & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
+ enc_obj_type = (le16_to_cpu(path->usGraphicObjIds[j]) & OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
if (enc_obj_type == GRAPH_OBJECT_TYPE_ENCODER) {
if (enc_obj_num == 2)
@@ -1826,15 +1826,15 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
else
info->BiosConnector[i].linkb = FALSE;
- if (!radeon_add_encoder(pScrn, enc_obj_id, path->usDeviceTag))
+ if (!radeon_add_encoder(pScrn, enc_obj_id, le16_to_cpu(path->usDeviceTag)))
return FALSE;
}
}
/* look up gpio for ddc */
- if ((path->usDeviceTag & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) == 0) {
+ if ((le16_to_cpu(path->usDeviceTag) & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) == 0) {
for (j = 0; j < con_obj->ucNumberOfObjects; j++) {
- if (path->usConnObjectId == le16_to_cpu(con_obj->asObjects[j].usObjectID)) {
+ if (le16_to_cpu(path->usConnObjectId) == le16_to_cpu(con_obj->asObjects[j].usObjectID)) {
ATOM_COMMON_RECORD_HEADER *Record = (ATOM_COMMON_RECORD_HEADER *)
((char *)&atomDataPtr->Object_Header->sHeader
+ le16_to_cpu(con_obj->asObjects[j].usRecordOffset));