Commit f066a17d authored by Adam Jackson's avatar Adam Jackson Committed by Dave Airlie

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: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 93dc6c2b
...@@ -528,6 +528,7 @@ bad_std_timing(u8 a, u8 b) ...@@ -528,6 +528,7 @@ bad_std_timing(u8 a, u8 b)
*/ */
struct drm_display_mode *drm_mode_std(struct drm_device *dev, struct drm_display_mode *drm_mode_std(struct drm_device *dev,
struct std_timing *t, struct std_timing *t,
int revision,
int timing_level) int timing_level)
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
...@@ -546,9 +547,12 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev, ...@@ -546,9 +547,12 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
/* vrefresh_rate = vfreq + 60 */ /* vrefresh_rate = vfreq + 60 */
vrefresh_rate = vfreq + 60; vrefresh_rate = vfreq + 60;
/* the vdisplay is calculated based on the aspect ratio */ /* the vdisplay is calculated based on the aspect ratio */
if (aspect_ratio == 0) if (aspect_ratio == 0) {
if (revision < 3)
vsize = hsize;
else
vsize = (hsize * 10) / 16; vsize = (hsize * 10) / 16;
else if (aspect_ratio == 1) } else if (aspect_ratio == 1)
vsize = (hsize * 3) / 4; vsize = (hsize * 3) / 4;
else if (aspect_ratio == 2) else if (aspect_ratio == 2)
vsize = (hsize * 4) / 5; vsize = (hsize * 4) / 5;
...@@ -797,7 +801,7 @@ static int add_standard_modes(struct drm_connector *connector, struct edid *edid ...@@ -797,7 +801,7 @@ static int add_standard_modes(struct drm_connector *connector, struct edid *edid
continue; continue;
newmode = drm_mode_std(dev, &edid->standard_timings[i], newmode = drm_mode_std(dev, &edid->standard_timings[i],
timing_level); edid->revision, timing_level);
if (newmode) { if (newmode) {
drm_mode_probed_add(connector, newmode); drm_mode_probed_add(connector, newmode);
modes++; modes++;
...@@ -853,6 +857,7 @@ static int add_detailed_info(struct drm_connector *connector, ...@@ -853,6 +857,7 @@ static int add_detailed_info(struct drm_connector *connector,
std = &data->data.timings[j]; std = &data->data.timings[j];
newmode = drm_mode_std(dev, std, newmode = drm_mode_std(dev, std,
edid->revision,
timing_level); timing_level);
if (newmode) { if (newmode) {
drm_mode_probed_add(connector, newmode); drm_mode_probed_add(connector, newmode);
...@@ -981,7 +986,9 @@ static int add_detailed_info_eedid(struct drm_connector *connector, ...@@ -981,7 +986,9 @@ static int add_detailed_info_eedid(struct drm_connector *connector,
struct drm_display_mode *newmode; struct drm_display_mode *newmode;
std = &data->data.timings[j]; std = &data->data.timings[j];
newmode = drm_mode_std(dev, std, timing_level); newmode = drm_mode_std(dev, std,
edid->revision,
timing_level);
if (newmode) { if (newmode) {
drm_mode_probed_add(connector, newmode); drm_mode_probed_add(connector, newmode);
modes++; modes++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment