diff options
author | Adam Jackson <ajax@redhat.com> | 2010-03-29 17:43:23 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-05 20:40:20 -0400 |
commit | 7466f4cc508878a8328dff1c328a2b4108888d2e (patch) | |
tree | a46b13cd8b1baa22f241d1e8c90809a73c333561 /drivers/gpu/drm/drm_edid.c | |
parent | 2255be14cb82370a6af4054edb3b4cd170d80752 (diff) |
drm/edid: Remove arbitrary EDID extension limit
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 58b67932f04a..cf24ecab6a4a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -1325,7 +1325,6 @@ static int add_detailed_info_eedid(struct drm_connector *connector, | |||
1325 | int i, modes = 0; | 1325 | int i, modes = 0; |
1326 | char *edid_ext = NULL; | 1326 | char *edid_ext = NULL; |
1327 | struct detailed_timing *timing; | 1327 | struct detailed_timing *timing; |
1328 | int edid_ext_num; | ||
1329 | int start_offset, end_offset; | 1328 | int start_offset, end_offset; |
1330 | int timing_level; | 1329 | int timing_level; |
1331 | 1330 | ||
@@ -1342,19 +1341,15 @@ static int add_detailed_info_eedid(struct drm_connector *connector, | |||
1342 | return 0; | 1341 | return 0; |
1343 | } | 1342 | } |
1344 | 1343 | ||
1345 | /* Chose real EDID extension number */ | ||
1346 | edid_ext_num = edid->extensions > DRM_MAX_EDID_EXT_NUM ? | ||
1347 | DRM_MAX_EDID_EXT_NUM : edid->extensions; | ||
1348 | |||
1349 | /* Find CEA extension */ | 1344 | /* Find CEA extension */ |
1350 | for (i = 0; i < edid_ext_num; i++) { | 1345 | for (i = 0; i < edid->extensions; i++) { |
1351 | edid_ext = (char *)edid + EDID_LENGTH * (i + 1); | 1346 | edid_ext = (char *)edid + EDID_LENGTH * (i + 1); |
1352 | /* This block is CEA extension */ | 1347 | /* This block is CEA extension */ |
1353 | if (edid_ext[0] == 0x02) | 1348 | if (edid_ext[0] == 0x02) |
1354 | break; | 1349 | break; |
1355 | } | 1350 | } |
1356 | 1351 | ||
1357 | if (i == edid_ext_num) { | 1352 | if (i == edid->extensions) { |
1358 | /* if there is no additional timing EDID block, return */ | 1353 | /* if there is no additional timing EDID block, return */ |
1359 | return 0; | 1354 | return 0; |
1360 | } | 1355 | } |
@@ -1393,7 +1388,7 @@ static int add_detailed_info_eedid(struct drm_connector *connector, | |||
1393 | bool drm_detect_hdmi_monitor(struct edid *edid) | 1388 | bool drm_detect_hdmi_monitor(struct edid *edid) |
1394 | { | 1389 | { |
1395 | char *edid_ext = NULL; | 1390 | char *edid_ext = NULL; |
1396 | int i, hdmi_id, edid_ext_num; | 1391 | int i, hdmi_id; |
1397 | int start_offset, end_offset; | 1392 | int start_offset, end_offset; |
1398 | bool is_hdmi = false; | 1393 | bool is_hdmi = false; |
1399 | 1394 | ||
@@ -1401,19 +1396,15 @@ bool drm_detect_hdmi_monitor(struct edid *edid) | |||
1401 | if (edid == NULL || edid->extensions == 0) | 1396 | if (edid == NULL || edid->extensions == 0) |
1402 | goto end; | 1397 | goto end; |
1403 | 1398 | ||
1404 | /* Chose real EDID extension number */ | ||
1405 | edid_ext_num = edid->extensions > DRM_MAX_EDID_EXT_NUM ? | ||
1406 | DRM_MAX_EDID_EXT_NUM : edid->extensions; | ||
1407 | |||
1408 | /* Find CEA extension */ | 1399 | /* Find CEA extension */ |
1409 | for (i = 0; i < edid_ext_num; i++) { | 1400 | for (i = 0; i < edid->extensions; i++) { |
1410 | edid_ext = (char *)edid + EDID_LENGTH * (i + 1); | 1401 | edid_ext = (char *)edid + EDID_LENGTH * (i + 1); |
1411 | /* This block is CEA extension */ | 1402 | /* This block is CEA extension */ |
1412 | if (edid_ext[0] == 0x02) | 1403 | if (edid_ext[0] == 0x02) |
1413 | break; | 1404 | break; |
1414 | } | 1405 | } |
1415 | 1406 | ||
1416 | if (i == edid_ext_num) | 1407 | if (i == edid->extensions) |
1417 | goto end; | 1408 | goto end; |
1418 | 1409 | ||
1419 | /* Data block offset in CEA extension block */ | 1410 | /* Data block offset in CEA extension block */ |