aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-09-23 17:31:21 -0400
committerDave Airlie <airlied@redhat.com>2009-09-23 19:46:08 -0400
commitf066a17d9f8d0a20d01d1aa9badce7f43c7bd6ad (patch)
tree49e80bea2a233fe0a36fdde0c47b5159d3753925 /drivers/gpu
parent93dc6c2b0d97a55508144073838e041140b206cd (diff)
drm/edid: Fix standard timing parse for EDID <= 1.2
Aspect ratio code of 0 means 1:1 before EDID 1.3. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_edid.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 8ed732ae1ecc..9888c2076b2e 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -528,6 +528,7 @@ bad_std_timing(u8 a, u8 b)
528 */ 528 */
529struct drm_display_mode *drm_mode_std(struct drm_device *dev, 529struct drm_display_mode *drm_mode_std(struct drm_device *dev,
530 struct std_timing *t, 530 struct std_timing *t,
531 int revision,
531 int timing_level) 532 int timing_level)
532{ 533{
533 struct drm_display_mode *mode; 534 struct drm_display_mode *mode;
@@ -546,9 +547,12 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
546 /* vrefresh_rate = vfreq + 60 */ 547 /* vrefresh_rate = vfreq + 60 */
547 vrefresh_rate = vfreq + 60; 548 vrefresh_rate = vfreq + 60;
548 /* the vdisplay is calculated based on the aspect ratio */ 549 /* the vdisplay is calculated based on the aspect ratio */
549 if (aspect_ratio == 0) 550 if (aspect_ratio == 0) {
550 vsize = (hsize * 10) / 16; 551 if (revision < 3)
551 else if (aspect_ratio == 1) 552 vsize = hsize;
553 else
554 vsize = (hsize * 10) / 16;
555 } else if (aspect_ratio == 1)
552 vsize = (hsize * 3) / 4; 556 vsize = (hsize * 3) / 4;
553 else if (aspect_ratio == 2) 557 else if (aspect_ratio == 2)
554 vsize = (hsize * 4) / 5; 558 vsize = (hsize * 4) / 5;
@@ -797,7 +801,7 @@ static int add_standard_modes(struct drm_connector *connector, struct edid *edid
797 continue; 801 continue;
798 802
799 newmode = drm_mode_std(dev, &edid->standard_timings[i], 803 newmode = drm_mode_std(dev, &edid->standard_timings[i],
800 timing_level); 804 edid->revision, timing_level);
801 if (newmode) { 805 if (newmode) {
802 drm_mode_probed_add(connector, newmode); 806 drm_mode_probed_add(connector, newmode);
803 modes++; 807 modes++;
@@ -853,6 +857,7 @@ static int add_detailed_info(struct drm_connector *connector,
853 857
854 std = &data->data.timings[j]; 858 std = &data->data.timings[j];
855 newmode = drm_mode_std(dev, std, 859 newmode = drm_mode_std(dev, std,
860 edid->revision,
856 timing_level); 861 timing_level);
857 if (newmode) { 862 if (newmode) {
858 drm_mode_probed_add(connector, newmode); 863 drm_mode_probed_add(connector, newmode);
@@ -981,7 +986,9 @@ static int add_detailed_info_eedid(struct drm_connector *connector,
981 struct drm_display_mode *newmode; 986 struct drm_display_mode *newmode;
982 987
983 std = &data->data.timings[j]; 988 std = &data->data.timings[j];
984 newmode = drm_mode_std(dev, std, timing_level); 989 newmode = drm_mode_std(dev, std,
990 edid->revision,
991 timing_level);
985 if (newmode) { 992 if (newmode) {
986 drm_mode_probed_add(connector, newmode); 993 drm_mode_probed_add(connector, newmode);
987 modes++; 994 modes++;