video: tegra: dc: fix CEA timings for hdmi
Jon Mayo [Wed, 20 Jul 2011 20:49:15 +0000 (13:49 -0700)]
Fixes the issue that timings are 1 clock too long in 720p and 1080p.

Bug 847774

Original-Change-Id: I3925ec1e64537daa27d6e697abe522ea17a87e1e
Reviewed-on: http://git-master/r/42488
Reviewed-by: Kevin Huang <kevinh@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Tested-by: Jonathan Mayo <jmayo@nvidia.com>

Rebase-Id: Rafbae1d4ae46bb13509af7ca59709e9f526bf6eb

drivers/video/tegra/dc/dc.c

index 1992d7d..f7c0ec8 100644 (file)
@@ -1557,10 +1557,12 @@ int tegra_dc_set_fb_mode(struct tegra_dc *dc,
        mode.h_front_porch = fbmode->right_margin;
        mode.v_front_porch = fbmode->lower_margin;
        mode.stereo_mode = stereo_mode;
-       if (calc_ref_to_sync(&mode)) {
-               dev_err(&dc->ndev->dev, "bad href/vref values, overriding.\n");
-               mode.h_ref_to_sync = 11;
+       if (dc->out->type == TEGRA_DC_OUT_HDMI) {
+               /* HDMI controller requires h_ref=1, v_ref=1 */
+               mode.h_ref_to_sync = 1;
                mode.v_ref_to_sync = 1;
+       } else {
+               calc_ref_to_sync(&mode);
        }
        if (!check_ref_to_sync(&mode)) {
                dev_err(&dc->ndev->dev,