From patchwork Wed Dec 19 21:38:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 1897351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id D9DC6DF230 for ; Wed, 19 Dec 2012 21:40:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD347E65D3 for ; Wed, 19 Dec 2012 13:40:17 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from km20343-01.keymachine.de (ns.km20343-01.keymachine.de [84.19.182.79]) by gabe.freedesktop.org (Postfix) with ESMTP id 021FEE5F86 for ; Wed, 19 Dec 2012 13:39:02 -0800 (PST) Received: from localhost.localdomain (f053085050.adsl.alicedsl.de [78.53.85.50]) by km20343-01.keymachine.de (Postfix) with ESMTPA id 1E3AA7D42E3; Wed, 19 Dec 2012 22:39:02 +0100 (CET) From: Lucas Stach To: dri-devel@lists.freedesktop.org Subject: =?UTF-8?q?=5BPATCH=201/6=5D=20drm=3A=20tegra=3A=20fix=20front=5Fporch=20=3C-=3E=20back=5Fporch=20mixup?= Date: Wed, 19 Dec 2012 22:38:52 +0100 Message-Id: <1355953137-31563-2-git-send-email-dev@lynxeye.de> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1355953137-31563-1-git-send-email-dev@lynxeye.de> References: <1355953137-31563-1-git-send-email-dev@lynxeye.de> MIME-Version: 1.0 Cc: "linux-tegra@vger.kernel.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Fixes wrong picture offset observed when using HDMI output with a Technisat HD TV. Signed-off-by: Lucas Stach Acked-by: Mark Zhang Tested-by: Mark Zhang --- Captions are a bit confusing here. As the porch is always relative to the sync pulse, the left picture margin is actually the back_porch. --- drivers/gpu/drm/tegra/dc.c | 8 ++++---- drivers/gpu/drm/tegra/hdmi.c | 6 +++--- 2 Dateien geändert, 7 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 0744103..54683e4 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, ((mode->hsync_end - mode->hsync_start) << 0); tegra_dc_writel(dc, value, DC_DISP_SYNC_WIDTH); - value = ((mode->vsync_start - mode->vdisplay) << 16) | - ((mode->hsync_start - mode->hdisplay) << 0); - tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH); - value = ((mode->vtotal - mode->vsync_end) << 16) | ((mode->htotal - mode->hsync_end) << 0); + tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH); + + value = ((mode->vsync_start - mode->vdisplay) << 16) | + ((mode->hsync_start - mode->hdisplay) << 0); tegra_dc_writel(dc, value, DC_DISP_FRONT_PORCH); value = (mode->vdisplay << 16) | mode->hdisplay; diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index ab40164..81ea934 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, return; } - h_front_porch = mode->htotal - mode->hsync_end; + h_front_porch = mode->hsync_start - mode->hdisplay; memset(&frame, 0, sizeof(frame)); frame.r = HDMI_AVI_R_SAME; @@ -634,8 +634,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) pclk = mode->clock * 1000; h_sync_width = mode->hsync_end - mode->hsync_start; - h_front_porch = mode->htotal - mode->hsync_end; - h_back_porch = mode->hsync_start - mode->hdisplay; + h_back_porch = mode->htotal - mode->hsync_end; + h_front_porch = mode->hsync_start - mode->hdisplay; err = regulator_enable(hdmi->vdd); if (err < 0) {