drm/radeon/kms: fix extended lvds info parsing

On rev <= 1.1 tables, the offset is absolute,
on newer tables, it's relative.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=700326

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Alex Deucher 2011-05-11 14:02:07 -04:00 committed by Dave Airlie
parent d9282fca8a
commit 05fa7ea7d2
1 changed files with 11 additions and 3 deletions

View File

@ -1574,7 +1574,15 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record; ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record;
ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record; ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record;
bool bad_record = false; bool bad_record = false;
u8 *record = (u8 *)(mode_info->atom_context->bios + u8 *record;
if ((frev == 1) && (crev < 2))
/* absolute */
record = (u8 *)(mode_info->atom_context->bios +
le16_to_cpu(lvds_info->info.usModePatchTableOffset));
else
/* relative */
record = (u8 *)(mode_info->atom_context->bios +
data_offset + data_offset +
le16_to_cpu(lvds_info->info.usModePatchTableOffset)); le16_to_cpu(lvds_info->info.usModePatchTableOffset));
while (*record != ATOM_RECORD_END_TYPE) { while (*record != ATOM_RECORD_END_TYPE) {