]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
drm/edid: Fix the HDTV hack.
authorAdam Jackson <ajax@redhat.com>
Mon, 29 Mar 2010 21:43:28 +0000 (21:43 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 6 Apr 2010 00:40:23 +0000 (10:40 +1000)
Standard timings don't let you say 1366.  Both 1360 and 1368 have been
seen in the wild.  So invent a CVT timing for it.  CVT will round 1366 up
to 1368; we'll then manually underscan it.

Split this into two parts, since we need to do something sneaky between
them in the future.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_edid.c

index e746dd56658a81bfb07fa0c85285a7f9c7bf2339..d7214389c2d6f1029ec1ce1ed1638621ad672a0c 100644 (file)
@@ -765,15 +765,25 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
                vsize = (hsize * 4) / 5;
        else
                vsize = (hsize * 9) / 16;
-       /* HDTV hack */
-       if (hsize == 1360 && vsize == 765 && vrefresh_rate == 60) {
-               mode = drm_cvt_mode(dev, hsize, vsize, vrefresh_rate, 0, 0,
+
+       /* HDTV hack, part 1 */
+       if (vrefresh_rate == 60 &&
+           ((hsize == 1360 && vsize == 765) ||
+            (hsize == 1368 && vsize == 769))) {
+               hsize = 1366;
+               vsize = 768;
+       }
+
+       /* HDTV hack, part 2 */
+       if (hsize == 1366 && vsize == 768 && vrefresh_rate == 60) {
+               mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0,
                                    false);
                mode->hdisplay = 1366;
                mode->vsync_start = mode->vsync_start - 1;
                mode->vsync_end = mode->vsync_end - 1;
                return mode;
        }
+
        mode = NULL;
        /* check whether it can be found in default mode table */
        mode = drm_find_dmt(dev, hsize, vsize, vrefresh_rate);