aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2012-12-19 16:38:52 -0500
committerDave Airlie <airlied@redhat.com>2012-12-29 23:01:31 -0500
commit4049508988a6ad03f51c33bf035bd9b603454830 (patch)
tree65e2f7405c513b180819ab4545faaf8c97c040e2
parent8be0e5c427c18a59ce261c496ae2193cbcbafffd (diff)
drm: tegra: fix front_porch <-> back_porch mixup
Fixes wrong picture offset observed when using HDMI output with a Technisat HD TV. Signed-off-by: Lucas Stach <dev@lynxeye.de> Acked-by: Mark Zhang <markz@nvidia.com> Tested-by: Mark Zhang <markz@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/tegra/dc.c8
-rw-r--r--drivers/gpu/drm/tegra/hdmi.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 074410371e2a..54683e430c77 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -102,12 +102,12 @@ static int tegra_dc_set_timings(struct tegra_dc *dc,
102 ((mode->hsync_end - mode->hsync_start) << 0); 102 ((mode->hsync_end - mode->hsync_start) << 0);
103 tegra_dc_writel(dc, value, DC_DISP_SYNC_WIDTH); 103 tegra_dc_writel(dc, value, DC_DISP_SYNC_WIDTH);
104 104
105 value = ((mode->vsync_start - mode->vdisplay) << 16) |
106 ((mode->hsync_start - mode->hdisplay) << 0);
107 tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH);
108
109 value = ((mode->vtotal - mode->vsync_end) << 16) | 105 value = ((mode->vtotal - mode->vsync_end) << 16) |
110 ((mode->htotal - mode->hsync_end) << 0); 106 ((mode->htotal - mode->hsync_end) << 0);
107 tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH);
108
109 value = ((mode->vsync_start - mode->vdisplay) << 16) |
110 ((mode->hsync_start - mode->hdisplay) << 0);
111 tegra_dc_writel(dc, value, DC_DISP_FRONT_PORCH); 111 tegra_dc_writel(dc, value, DC_DISP_FRONT_PORCH);
112 112
113 value = (mode->vdisplay << 16) | mode->hdisplay; 113 value = (mode->vdisplay << 16) | mode->hdisplay;
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index ab4016412bbf..81ea934214f1 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -479,7 +479,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,
479 return; 479 return;
480 } 480 }
481 481
482 h_front_porch = mode->htotal - mode->hsync_end; 482 h_front_porch = mode->hsync_start - mode->hdisplay;
483 memset(&frame, 0, sizeof(frame)); 483 memset(&frame, 0, sizeof(frame));
484 frame.r = HDMI_AVI_R_SAME; 484 frame.r = HDMI_AVI_R_SAME;
485 485
@@ -634,8 +634,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output)
634 634
635 pclk = mode->clock * 1000; 635 pclk = mode->clock * 1000;
636 h_sync_width = mode->hsync_end - mode->hsync_start; 636 h_sync_width = mode->hsync_end - mode->hsync_start;
637 h_front_porch = mode->htotal - mode->hsync_end; 637 h_back_porch = mode->htotal - mode->hsync_end;
638 h_back_porch = mode->hsync_start - mode->hdisplay; 638 h_front_porch = mode->hsync_start - mode->hdisplay;
639 639
640 err = regulator_enable(hdmi->vdd); 640 err = regulator_enable(hdmi->vdd);
641 if (err < 0) { 641 if (err < 0) {