diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-04-20 13:05:18 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-04-20 13:05:18 -0400 |
commit | d096d1189c8dc5e19f68cc605ccffe1a8fef048b (patch) | |
tree | 08d8c3ed05e14d0c9d208d4fbe0c19d587d9f418 | |
parent | 101ce28ec4af696549b7d6defebb5b4ad412176c (diff) |
Endian fixes for object table
-rw-r--r-- | src/radeon_atombios.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index 2aa59116..dc101cf7 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1814,17 +1814,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; @@ -1832,7 +1832,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; } @@ -1863,15 +1863,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) @@ -1879,15 +1879,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)); |