drm/radeon: fix LCD record parsing
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 20 Aug 2013 18:59:01 +0000 (14:59 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Aug 2013 20:31:03 +0000 (16:31 -0400)
If the LCD table contains an EDID record, properly account
for the edid size when walking through the records.

This should fix error messages about unknown LCD records.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/radeon_atombios.c

index 4ac5f4027620c69c638b316822d5ab481b2f8810..112c96352562474b271ff9abde4a4b3fdf542eb3 100644 (file)
@@ -1681,7 +1681,9 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
                                                                kfree(edid);
                                                }
                                        }
-                                       record += sizeof(ATOM_FAKE_EDID_PATCH_RECORD);
+                                       record += fake_edid_record->ucFakeEDIDLength ?
+                                               fake_edid_record->ucFakeEDIDLength + 2 :
+                                               sizeof(ATOM_FAKE_EDID_PATCH_RECORD);
                                        break;
                                case LCD_PANEL_RESOLUTION_RECORD_TYPE:
                                        panel_res_record = (ATOM_PANEL_RESOLUTION_PATCH_RECORD *)record;