diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3326987a988b..dd35dc11ffd4 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -502,6 +502,19 @@ static struct drm_display_mode *drm_find_dmt(struct drm_device *dev, | |||
502 | } | 502 | } |
503 | return mode; | 503 | return mode; |
504 | } | 504 | } |
505 | |||
506 | /* | ||
507 | * 0 is reserved. The spec says 0x01 fill for unused timings. Some old | ||
508 | * monitors fill with ascii space (0x20) instead. | ||
509 | */ | ||
510 | static int | ||
511 | bad_std_timing(u8 a, u8 b) | ||
512 | { | ||
513 | return (a == 0x00 && b == 0x00) || | ||
514 | (a == 0x01 && b == 0x01) || | ||
515 | (a == 0x20 && b == 0x20); | ||
516 | } | ||
517 | |||
505 | /** | 518 | /** |
506 | * drm_mode_std - convert standard mode info (width, height, refresh) into mode | 519 | * drm_mode_std - convert standard mode info (width, height, refresh) into mode |
507 | * @t: standard timing params | 520 | * @t: standard timing params |
@@ -525,6 +538,9 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev, | |||
525 | unsigned vfreq = (t->vfreq_aspect & EDID_TIMING_VFREQ_MASK) | 538 | unsigned vfreq = (t->vfreq_aspect & EDID_TIMING_VFREQ_MASK) |
526 | >> EDID_TIMING_VFREQ_SHIFT; | 539 | >> EDID_TIMING_VFREQ_SHIFT; |
527 | 540 | ||
541 | if (bad_std_timing(t->hsize, t->vfreq_aspect)) | ||
542 | return NULL; | ||
543 | |||
528 | /* According to the EDID spec, the hdisplay = hsize * 8 + 248 */ | 544 | /* According to the EDID spec, the hdisplay = hsize * 8 + 248 */ |
529 | hsize = t->hsize * 8 + 248; | 545 | hsize = t->hsize * 8 + 248; |
530 | /* vrefresh_rate = vfreq + 60 */ | 546 | /* vrefresh_rate = vfreq + 60 */ |